Run a single test in a worker thread.
(test_path: Path)
| 596 | error_msg: str = "" |
| 597 | |
| 598 | def _run_one_test(test_path: Path) -> _WorkerResult: |
| 599 | """Run a single test in a worker thread.""" |
| 600 | if halt_event.is_set(): |
| 601 | return _WorkerResult(test_path, TestResult(success=False)) |
| 602 | try: |
| 603 | return _WorkerResult(test_path, test_callback(test_path)) |
| 604 | except KeyboardInterrupt as ki: |
| 605 | handle_keyboard_interrupt(ki) |
| 606 | return _WorkerResult(test_path, TestResult(success=False), "Interrupted") |
| 607 | except Exception as e: |
| 608 | return _WorkerResult(test_path, TestResult(success=False), str(e)) |
| 609 | |
| 610 | # Do NOT use `with` for the executor — its __exit__ calls |
| 611 | # shutdown(wait=True) which blocks until every running worker |
nothing calls this directly
no test coverage detected