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

Function get_all_tests

scripts/update_lib/cmd_todo.py:136–161  ·  view source on GitHub ↗

Get all test module names from cpython/Lib/test/. Returns: Sorted list of test names (e.g., ["test_abc", "test_dis", ...])

(cpython_prefix: str)

Source from the content-addressed store, hash-verified

134
135
136def get_all_tests(cpython_prefix: str) -> list[str]:
137 """Get all test module names from cpython/Lib/test/.
138
139 Returns:
140 Sorted list of test names (e.g., ["test_abc", "test_dis", ...])
141 """
142 test_dir = pathlib.Path(cpython_prefix) / "Lib" / "test"
143 if not test_dir.exists():
144 return []
145
146 tests = set()
147 for entry in test_dir.iterdir():
148 # Skip non-test items
149 if "test" not in entry.name:
150 continue
151
152 # Exclude special cases
153 if "regrtest" in entry.name:
154 continue
155
156 if entry.is_file() and entry.suffix == ".py":
157 tests.add(entry.stem)
158 elif entry.is_dir() and (entry / "__init__.py").exists():
159 tests.add(entry.name)
160
161 return sorted(tests)
162
163
164def get_untracked_files(

Callers 1

compute_test_todo_listFunction · 0.85

Calls 7

setFunction · 0.85
sortedFunction · 0.85
existsMethod · 0.45
iterdirMethod · 0.45
is_fileMethod · 0.45
addMethod · 0.45
is_dirMethod · 0.45

Tested by

no test coverage detected