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

Function run_unittest

Lib/test/libregrtest/single.py:31–42  ·  view source on GitHub ↗
(test_mod, runtests: RunTests)

Source from the content-addressed store, hash-verified

29
30
31def run_unittest(test_mod, runtests: RunTests):
32 loader = unittest.TestLoader()
33 tests = loader.loadTestsFromModule(test_mod)
34
35 for error in loader.errors:
36 print(error, file=sys.stderr)
37 if loader.errors:
38 raise Exception("errors while loading tests")
39 _filter_suite(tests, match_test)
40 if runtests.parallel_threads:
41 _parallelize_tests(tests, runtests.parallel_threads)
42 return _run_suite(tests)
43
44def _filter_suite(suite, pred):
45 """Recursively filter test cases in a suite based on a predicate."""

Callers 2

test_funcFunction · 0.85

Calls 4

loadTestsFromModuleMethod · 0.95
_filter_suiteFunction · 0.85
_parallelize_testsFunction · 0.85
_run_suiteFunction · 0.85

Tested by 2

test_funcFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…