Skip to content

Commit 181c090

Browse files
committed
refactor(tests): extract console module path constant
1 parent 6f5536e commit 181c090

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/aignostics_foundry_core/console_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
CUSTOM_ENV_PREFIX = "TESTPROJ_"
1515
CUSTOM_WIDTH = "120"
1616
EXPECTED_CUSTOM_WIDTH = 120
17+
CONSOLE_MODULE = "aignostics_foundry_core.console"
1718

1819

1920
@pytest.fixture(autouse=True)
@@ -36,7 +37,7 @@ def test_console_is_console_instance(self) -> None:
3637
@pytest.mark.sequential
3738
def test_console_default_width(self, monkeypatch: pytest.MonkeyPatch) -> None:
3839
"""Module-level console has Rich's default width (80) when no context is set."""
39-
reloaded = importlib.reload(sys.modules["aignostics_foundry_core.console"])
40+
reloaded = importlib.reload(sys.modules[CONSOLE_MODULE])
4041
assert reloaded.console.width == 80
4142

4243
@pytest.mark.unit
@@ -52,14 +53,14 @@ def test_console_width_uses_env_prefix_from_context(self, monkeypatch: pytest.Mo
5253
)
5354
set_context(ctx)
5455
monkeypatch.setenv(f"{CUSTOM_ENV_PREFIX}CONSOLE_WIDTH", CUSTOM_WIDTH)
55-
reloaded = importlib.reload(sys.modules["aignostics_foundry_core.console"])
56+
reloaded = importlib.reload(sys.modules[CONSOLE_MODULE])
5657
assert reloaded.console.width == EXPECTED_CUSTOM_WIDTH
5758

5859
@pytest.mark.unit
5960
@pytest.mark.sequential
6061
def test_console_width_is_auto_when_no_context(self, monkeypatch: pytest.MonkeyPatch) -> None:
6162
"""Console width defaults to Rich's auto-detection (80 in non-TTY) when no context is set."""
62-
reloaded = importlib.reload(sys.modules["aignostics_foundry_core.console"])
63+
reloaded = importlib.reload(sys.modules[CONSOLE_MODULE])
6364
assert reloaded.console.width == 80
6465

6566
@pytest.mark.unit

0 commit comments

Comments
 (0)