(
self, test_name: TestName, runtests: RunTests, tracer: trace.Trace | None
)
| 376 | self.quiet, self.print_slowest) |
| 377 | |
| 378 | def run_test( |
| 379 | self, test_name: TestName, runtests: RunTests, tracer: trace.Trace | None |
| 380 | ) -> TestResult: |
| 381 | if tracer is not None: |
| 382 | # If we're tracing code coverage, then we don't exit with status |
| 383 | # if on a false return value from main. |
| 384 | cmd = ('result = run_single_test(test_name, runtests)') |
| 385 | namespace = dict(locals()) |
| 386 | tracer.runctx(cmd, globals=globals(), locals=namespace) |
| 387 | result = namespace['result'] |
| 388 | result.covered_lines = list(tracer.counts) |
| 389 | else: |
| 390 | result = run_single_test(test_name, runtests) |
| 391 | |
| 392 | self.results.accumulate_result(result, runtests) |
| 393 | |
| 394 | return result |
| 395 | |
| 396 | def run_tests_sequentially(self, runtests: RunTests) -> None: |
| 397 | if self.coverage: |
no test coverage detected