MCPcopy Index your code
hub / github.com/python/cpython / run_tests

Method run_tests

Lib/test/libregrtest/main.py:580–595  ·  view source on GitHub ↗
(self, selected: TestTuple, tests: TestList | None)

Source from the content-addressed store, hash-verified

578 self.fail_rerun)
579
580 def run_tests(self, selected: TestTuple, tests: TestList | None) -> int:
581 os.makedirs(self.tmp_dir, exist_ok=True)
582 work_dir = get_work_dir(self.tmp_dir)
583
584 # Put a timeout on Python exit
585 with exit_timeout():
586 # Run the tests in a context manager that temporarily changes the
587 # CWD to a temporary and writable directory. If it's not possible
588 # to create or change the CWD, the original CWD will be used.
589 # The original CWD is available from os_helper.SAVEDCWD.
590 with os_helper.temp_cwd(work_dir, quiet=True):
591 # When using multiprocessing, worker processes will use
592 # work_dir as their parent temporary directory. So when the
593 # main process exit, it removes also subdirectories of worker
594 # processes.
595 return self._run_tests(selected, tests)
596
597 def _add_cross_compile_opts(self, regrtest_opts):
598 # WASM/WASI buildbot builders pass multiple PYTHON environment

Callers 1

mainMethod · 0.95

Calls 3

_run_testsMethod · 0.95
get_work_dirFunction · 0.85
exit_timeoutFunction · 0.85

Tested by

no test coverage detected