File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1010
1111pytestmark = pytest .mark .architecture
1212
13- _TARGET_FILES = (
13+ MAPPING_READER_TARGET_FILES = (
1414 Path ("hyperbrowser/client/managers/response_utils.py" ),
1515 Path ("hyperbrowser/transport/base.py" ),
1616 Path ("hyperbrowser/client/managers/list_parsing_utils.py" ),
@@ -21,7 +21,7 @@ def test_core_mapping_parsers_use_shared_mapping_reader():
2121 violations : list [str ] = []
2222 missing_reader_calls : list [str ] = []
2323
24- for relative_path in _TARGET_FILES :
24+ for relative_path in MAPPING_READER_TARGET_FILES :
2525 module = read_module_ast (relative_path )
2626 list_keys_calls = collect_list_keys_call_lines (module )
2727 if list_keys_calls :
Original file line number Diff line number Diff line change 33
44import pytest
55
6+ from tests .test_mapping_reader_usage import MAPPING_READER_TARGET_FILES
7+
68pytestmark = pytest .mark .architecture
79
810
9- EXPECTED_MAPPING_UTILS_IMPORTERS = (
10- "hyperbrowser/client/managers/list_parsing_utils.py" ,
11- "hyperbrowser/client/managers/response_utils.py" ,
12- "hyperbrowser/tools/__init__.py" ,
13- "hyperbrowser/transport/base.py" ,
14- "tests/test_mapping_utils.py" ,
15- )
11+ EXPECTED_MAPPING_EXTRA_IMPORTERS = ("tests/test_mapping_utils.py" ,)
12+ MAPPING_TOOL_IMPORTER = Path ("hyperbrowser/tools/__init__.py" )
1613
1714
1815def _imports_mapping_utils (module_text : str ) -> bool :
@@ -39,4 +36,8 @@ def test_mapping_utils_imports_are_centralized():
3936 if _imports_mapping_utils (module_text ):
4037 discovered_modules .append (module_path .as_posix ())
4138
42- assert discovered_modules == list (EXPECTED_MAPPING_UTILS_IMPORTERS )
39+ expected_runtime_modules = sorted (
40+ [* (path .as_posix () for path in MAPPING_READER_TARGET_FILES ), MAPPING_TOOL_IMPORTER .as_posix ()]
41+ )
42+ expected_modules = sorted ([* expected_runtime_modules , * EXPECTED_MAPPING_EXTRA_IMPORTERS ])
43+ assert discovered_modules == expected_modules
You can’t perform that action at this time.
0 commit comments