Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
george0st committed Oct 2, 2024
1 parent fc175a3 commit eeff27a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from qgate_perf.run_return import RunReturn
from qgate_perf.bundle_helper import BundleHelper
from qgate_perf.executor_helper import ExecutorHelper
from qgate_perf.output_setup import OutputSetup
import time
from os import path
import shutil
Expand Down Expand Up @@ -261,6 +262,25 @@ def test_general_exception2(self):
setup=RunSetup(duration_second=0, start_delay=0)
self.assertFalse(generator.run_executor([[1,1]], setup))

def test_different_output_precision(self):
generator = ParallelExecutor(prf_gil_impact,
label="GIL_impact",
detail_output=True,
output_file=path.join(self.OUTPUT_ADR, "perf_gil_impact_test.txt"))

setup=RunSetup(duration_second=4, start_delay=4)
OutputSetup().human_precision = 7
self.assertTrue(generator.run(2, 2, setup))

def test_different_output_json_separator(self):
generator = ParallelExecutor(prf_gil_impact,
label="GIL_impact",
detail_output=True,
output_file=path.join(self.OUTPUT_ADR, "perf_gil_impact_test.txt"))

setup = RunSetup(duration_second=4, start_delay=4)
OutputSetup().human_json_separator = (' - ', '::')
self.assertTrue(generator.run(2, 2, setup))

# if __name__ == '__main__':
# unittest.main()

0 comments on commit eeff27a

Please sign in to comment.