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)
| 1705 | |
| 1706 | |
| 1707 | def _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] |
no test coverage detected