Skip to content

Commit cda4d24

Browse files
committed
fix(test): isolate interpreter-discovery tests from ambient SYSTEM_PYTHON
The compat job exports SYSTEM_PYTHON for the venv-building CLI tests; the discovery unit tests fabricate their own interpreters and the ambient override short-circuited the walk they exercise. An autouse fixture clears it — verified passing both with and without the variable set.
1 parent 5fb2f3b commit cda4d24

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/test_env_interpreter.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
# ----------------------------------------------------------------------------------------------
2121

2222

23+
@pytest.fixture(autouse=True)
24+
def _no_ambient_system_python(monkeypatch):
25+
"""Discovery tests fabricate their own interpreters; an ambient
26+
SYSTEM_PYTHON (the CI compat job sets one for the venv-building CLI
27+
tests) would short-circuit the walk they are exercising."""
28+
monkeypatch.delenv("SYSTEM_PYTHON", raising=False)
29+
30+
2331
def test_grammar_stems_parse_to_versions():
2432
got = Codeanalyzer._versions_from_grammar_stems(
2533
["grammar36", "grammar39", "grammar310", "grammar313", "grammar314"]

0 commit comments

Comments
 (0)