You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: PYAUTOFIT_TEST_MODE is a dead env var — aggregator test-mode fixture is a silent no-op #95
The canonical test-mode knob is PYAUTO_TEST_MODE (read authoritatively in PyAutoNerves/autonerves/test_mode.py:14 via os.environ.get("PYAUTO_TEST_MODE", "0"), alongside PYAUTO_TEST_MODE_SAMPLES). Nothing anywhere reads PYAUTOFIT_TEST_MODE — verified by grep across every library and workspace repo.
test_autocti/aggregator/conftest.py uses the dead name in an autouse=True fixture, so the entire aggregator test module intends to run in test mode but never enters it.
Plan
Rename PYAUTOFIT_TEST_MODE → PYAUTO_TEST_MODE in test_autocti/aggregator/conftest.py (the set_test_mode fixture).
Run the aggregator suite afterwards — enabling test mode for the first time may surface previously-masked behaviour (test mode namespaces output paths and can bypass sampling).
Companion docstring fix in PyAutoFit (separate PR, same task): autofit/non_linear/analysis/visualize.pyVisualizer.should_visualize says "If PyAutoFit test mode is on" — naming the product rather than the variable is what leads readers to invent the wrong env var. Name PYAUTO_TEST_MODE explicitly.
autocti_workspace_test/AGENTS.md:42 and autocti_assistant/skills/ac_fit_cti_model.md:126already document that PYAUTOFIT_TEST_MODE does not exist. The trap was documented instead of deleted; this issue deletes it.
Out of scope (local-only, no PR)
Two gitignored.claude/settings.local.json allowlists (euclid_strong_lens_modeling_pipeline, autogalaxy_workspace) also use the dead name, meaning those allowlisted commands run without test mode. Fixed locally, not shipped.
Verification
pytest test_autocti/aggregator green with the corrected var.
Confirm the fixture actually takes effect (test mode active during those tests).
Correction to the plan above: the fix is to DELETE the fixture, not rename it.
The issue body proposed renaming PYAUTOFIT_TEST_MODE → PYAUTO_TEST_MODE. Testing showed that is the wrong fix. Making the variable live means test mode genuinely takes effect, which bypasses sampling — so the aggregator has no samples to iterate and 6 of the 13 aggregator tests fail. Those tests were written against, and only pass under, normal sampling.
Measured three ways (pytest test_autocti/aggregator):
Variant
Result
dead var present (baseline, main)
13 passed
renamed to PYAUTO_TEST_MODE
6 failed, 7 passed
fixture deleted
13 passed
Deleting is behaviour-preserving and removes the trap outright, so that is what shipped.
Also revised: the two gitignored .claude/settings.local.json allowlists are deliberately left alone. Rewriting PYAUTOFIT_TEST_MODE=1 → PYAUTO_TEST_MODE=1 there would change what those commands do (they have always run as normal full runs). They are stale permission strings, not a defect.
Both PRs merged: #96 (dead fixture deleted) and PyAutoLabs/PyAutoFit#1417 (docstring now names PYAUTO_TEST_MODE). Aggregator suite verified 13 passed with the fixture removed — behaviour-preserving. Closing.
Activity
Jammy2211 commentedon Jul 22, 2026
Correction to the plan above: the fix is to DELETE the fixture, not rename it.
The issue body proposed renaming
PYAUTOFIT_TEST_MODE→PYAUTO_TEST_MODE. Testing showed that is the wrong fix. Making the variable live means test mode genuinely takes effect, which bypasses sampling — so the aggregator has no samples to iterate and 6 of the 13 aggregator tests fail. Those tests were written against, and only pass under, normal sampling.Measured three ways (
pytest test_autocti/aggregator):main)PYAUTO_TEST_MODEDeleting is behaviour-preserving and removes the trap outright, so that is what shipped.
PRs: #96 (delete fixture) · PyAutoLabs/PyAutoFit#1417 (docstring names the real variable).
Also revised: the two gitignored
.claude/settings.local.jsonallowlists are deliberately left alone. RewritingPYAUTOFIT_TEST_MODE=1→PYAUTO_TEST_MODE=1there would change what those commands do (they have always run as normal full runs). They are stale permission strings, not a defect.fix: delete dead PYAUTOFIT_TEST_MODE fixture in aggregator conftest (#95
Jammy2211 commentedon Jul 22, 2026
Both PRs merged: #96 (dead fixture deleted) and PyAutoLabs/PyAutoFit#1417 (docstring now names
PYAUTO_TEST_MODE). Aggregator suite verified 13 passed with the fixture removed — behaviour-preserving. Closing.