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

Function _consolidate_file_key

scripts/update_lib/deps.py:1707–1721  ·  view source on GitHub ↗

Consolidate file_key to test name. Args: file_key: Relative path without .py (e.g., "test_foo", "test_bar/test_sub") Returns: Consolidated test name: - "test_foo" for "test_foo" - "test_sqlite3" for "test_sqlite3/test_dbapi"

(file_key: str)

Source from the content-addressed store, hash-verified

1705
1706
1707def _consolidate_file_key(file_key: str) -> str:
1708 """Consolidate file_key to test name.
1709
1710 Args:
1711 file_key: Relative path without .py (e.g., "test_foo", "test_bar/test_sub")
1712
1713 Returns:
1714 Consolidated test name:
1715 - "test_foo" for "test_foo"
1716 - "test_sqlite3" for "test_sqlite3/test_dbapi"
1717 """
1718 parts = pathlib.Path(file_key).parts
1719 if len(parts) == 1:
1720 return parts[0]
1721 return parts[0]

Callers 1

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected