MCPcopy Index your code
hub / github.com/RustPython/RustPython / run_tests

Method run_tests

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

Source from the content-addressed store, hash-verified

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