Skip to content

Tests: scrub ambient config env (fixes CI after #41) - #42

Merged
mikkel merged 1 commit into
mainfrom
fix/test-env-scrub-legacy-alias
Nov 28, 2026
Merged

mikkel merged 1 commit into
mainfrom
fix/test-env-scrub-legacy-alias

Conversation

@mikkel

@mikkel mikkel commented Nov 28, 2026

Copy link
Copy Markdown
Member

Follow-up to #41. The legacy GPTDIFF_ alias fallback means a CI-exported GPTDIFF_LLM_API_KEY resurrects a key that test_missing_api_key_raises_only_when_a_call_is_required deleted under its PATCHLING_ spelling, so the expected RuntimeError never raised.

Fix: an autouse fixture in tests/conftest.py removes every PATCHLING_* / GPTDIFF_* variable from the environment for each test. Tests that need a variable set it explicitly via monkeypatch.setenv, so the suite is hermetic against ambient configuration of either spelling.

Verified locally with legacy-named values planted in the ambient environment: 269 passed, 1 skipped.

…ak in

PR #41's legacy-alias fallback resurrects a GPTDIFF_LLM_API_KEY exported
by CI when a test deletes only the PATCHLING_ spelling, failing
test_missing_api_key_raises_only_when_a_call_is_required. An autouse
conftest fixture now removes every PATCHLING_*/GPTDIFF_* variable per
test; tests that need one set it explicitly. Verified locally with
legacy-named values in the ambient environment: 269 passed, 1 skipped.
@mikkel
mikkel merged commit ee2530a into main Nov 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant