Skip to content

Commit 7944446

Browse files
Refactor mapping symbol boundaries to shared extras
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent a50365d commit 7944446

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

tests/test_mapping_copy_helper_import_boundary.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
import pytest
55

6+
from tests.test_mapping_utils_import_boundary import EXPECTED_MAPPING_EXTRA_IMPORTERS
67
from tests.test_tool_mapping_reader_usage import TOOLS_MODULE
78

89
pytestmark = pytest.mark.architecture
910

1011

11-
EXPECTED_COPY_HELPER_EXTRA_IMPORTERS = ("tests/test_mapping_utils.py",)
12-
13-
1412
def _imports_copy_mapping_values_by_string_keys(module_text: str) -> bool:
1513
module_ast = ast.parse(module_text)
1614
for node in module_ast.body:
@@ -37,6 +35,6 @@ def test_copy_mapping_values_by_string_keys_imports_are_centralized():
3735
discovered_modules.append(module_path.as_posix())
3836

3937
expected_modules = sorted(
40-
[TOOLS_MODULE.as_posix(), *EXPECTED_COPY_HELPER_EXTRA_IMPORTERS]
38+
[TOOLS_MODULE.as_posix(), *EXPECTED_MAPPING_EXTRA_IMPORTERS]
4139
)
4240
assert discovered_modules == expected_modules

tests/test_mapping_read_keys_helper_import_boundary.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
import pytest
55

6+
from tests.test_mapping_utils_import_boundary import EXPECTED_MAPPING_EXTRA_IMPORTERS
67
from tests.test_tool_mapping_reader_usage import TOOLS_MODULE
78

89
pytestmark = pytest.mark.architecture
910

1011

11-
EXPECTED_READ_KEYS_HELPER_EXTRA_IMPORTERS = ("tests/test_mapping_utils.py",)
12-
13-
1412
def _imports_read_string_mapping_keys(module_text: str) -> bool:
1513
module_ast = ast.parse(module_text)
1614
for node in module_ast.body:
@@ -37,6 +35,6 @@ def test_read_string_mapping_keys_imports_are_centralized():
3735
discovered_modules.append(module_path.as_posix())
3836

3937
expected_modules = sorted(
40-
[TOOLS_MODULE.as_posix(), *EXPECTED_READ_KEYS_HELPER_EXTRA_IMPORTERS]
38+
[TOOLS_MODULE.as_posix(), *EXPECTED_MAPPING_EXTRA_IMPORTERS]
4139
)
4240
assert discovered_modules == expected_modules

0 commit comments

Comments
 (0)