Remove the unused timer code
This was an artefact from the beginning of Pynguin, where we wanted to
measure the time of the various steps.  Nowadays, Pynguin has the
concept of runtime/output variables than could be used for such a thing
with way less boilerplate code.  Thus, remove the old, unused stuff.
@@ -47,7 +47,6 @@ from pynguin.testcase.execution.testcaseexecutor import TestCaseExecutor
from pynguin.utils import randomness
from pynguin.utils.report import get_coverage_report, render_coverage_report
from pynguin.utils.statistics.runtimevariable import RuntimeVariable
-from pynguin.utils.statistics.timer import Timer
@enum.unique
@@ -95,7 +94,6 @@ def run_pynguin() -> ReturnCode:
def _setup_test_cluster() -> Optional[TestCluster]:
- with Timer(name="Test-cluster generation time", logger=None):
test_cluster = TestClusterGenerator(
config.configuration.module_name
).generate_cluster()
@@ -254,7 +252,6 @@ def _run() -> ReturnCode:
return ReturnCode.SETUP_FAILED
executor, test_cluster = setup_result
- with Timer(name="Test generation time", logger=None):
algorithm: TestGenerationStrategy = _instantiate_test_generation_strategy(
executor, test_cluster
)
@@ -264,7 +261,8 @@ def _run() -> ReturnCode:
_LOGGER.info("Used up all resources (%s).", algorithm.stopping_condition)
_LOGGER.info("Stop generating test cases")
- with Timer(name="Re-execution time", logger=None):
+ # Track coverage of the generated test suites.
+ # This possibly re-executes the test suites.
stat.track_output_variable(
RuntimeVariable.Coverage, generation_result.get_coverage()
)
@@ -283,7 +281,7 @@ def _run() -> ReturnCode:
generator = ag.AssertionGenerator(executor)
generation_result.accept(generator)
- with Timer(name="Export time", logger=None):
+ # Export the generated test suites
converter = cc.ChromosomeConverter()
generation_result.accept(converter)
failing = converter.failing_test_suite
@@ -301,9 +299,7 @@ def _run() -> ReturnCode:
"_failing",
wrap_code=True,
)
- _LOGGER.info(
- "Export %i failing test cases to %s", failing.size(), written_to
- )
+ _LOGGER.info("Export %i failing test cases to %s", failing.size(), written_to)
if config.configuration.statistics_output.create_coverage_report:
render_coverage_report(
