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

Function list_cases

Lib/test/libregrtest/findtests.py:92–112  ·  view source on GitHub ↗
(tests: TestTuple, *,
               match_tests: TestFilter | None = None,
               test_dir: StrPath | None = None)

Source from the content-addressed store, hash-verified

90 print(test.id())
91
92def list_cases(tests: TestTuple, *,
93 match_tests: TestFilter | None = None,
94 test_dir: StrPath | None = None) -> None:
95 support.verbose = False
96 set_match_tests(match_tests)
97
98 skipped = []
99 for test_name in tests:
100 module_name = abs_module_name(test_name, test_dir)
101 try:
102 suite = unittest.defaultTestLoader.loadTestsFromName(module_name)
103 _list_cases(suite)
104 except unittest.SkipTest:
105 skipped.append(test_name)
106
107 if skipped:
108 sys.stdout.flush()
109 stderr = sys.stderr
110 print(file=stderr)
111 print(count(len(skipped), "test"), "skipped:", file=stderr)
112 printlist(skipped, file=stderr)

Callers 1

mainMethod · 0.90

Calls 8

set_match_testsFunction · 0.85
abs_module_nameFunction · 0.85
_list_casesFunction · 0.85
countFunction · 0.85
printlistFunction · 0.85
loadTestsFromNameMethod · 0.80
appendMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…