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

Function get_test_paths

scripts/update_lib/deps.py:946–963  ·  view source on GitHub ↗

Get all test paths for a module. Args: name: Module name (e.g., "datetime", "libregrtest") cpython_prefix: CPython directory prefix Returns: Tuple of test paths

(name: str, cpython_prefix: str)

Source from the content-addressed store, hash-verified

944
945@functools.cache
946def get_test_paths(name: str, cpython_prefix: str) -> tuple[pathlib.Path, ...]:
947 """Get all test paths for a module.
948
949 Args:
950 name: Module name (e.g., "datetime", "libregrtest")
951 cpython_prefix: CPython directory prefix
952
953 Returns:
954 Tuple of test paths
955 """
956 if name in DEPENDENCIES and "test" in DEPENDENCIES[name]:
957 return tuple(
958 construct_lib_path(cpython_prefix, f"test/{p}")
959 for p in DEPENDENCIES[name]["test"]
960 )
961
962 # Default: try directory first, then file
963 return (resolve_module_path(f"test/test_{name}", cpython_prefix, prefer="dir"),)
964
965
966@functools.cache

Callers 6

mainFunction · 0.90
format_depsFunction · 0.90
_resolve_module_nameFunction · 0.90
test_known_dependencyMethod · 0.90
test_default_fileMethod · 0.90

Calls 2

construct_lib_pathFunction · 0.90
resolve_module_pathFunction · 0.90

Tested by 3

test_known_dependencyMethod · 0.72
test_default_fileMethod · 0.72