Overview
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.py Visualizer.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.
Detailed implementation plan
Affected Repositories
- PyAutoCTI (primary) — the real bug
- PyAutoFit — one misleading docstring
Suggested branch: feature/testmode-env-drift
The bug
test_autocti/aggregator/conftest.py:13-17
@pytest.fixture(autouse=True)
def set_test_mode():
os.environ["PYAUTOFIT_TEST_MODE"] = "1" # <- nothing reads this
yield
del os.environ["PYAUTOFIT_TEST_MODE"]
Why it persisted
autocti_workspace_test/AGENTS.md:42 and autocti_assistant/skills/ac_fit_cti_model.md:126 already 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).
Overview
The canonical test-mode knob is
PYAUTO_TEST_MODE(read authoritatively inPyAutoNerves/autonerves/test_mode.py:14viaos.environ.get("PYAUTO_TEST_MODE", "0"), alongsidePYAUTO_TEST_MODE_SAMPLES). Nothing anywhere readsPYAUTOFIT_TEST_MODE— verified by grep across every library and workspace repo.test_autocti/aggregator/conftest.pyuses the dead name in anautouse=Truefixture, so the entire aggregator test module intends to run in test mode but never enters it.Plan
PYAUTOFIT_TEST_MODE→PYAUTO_TEST_MODEintest_autocti/aggregator/conftest.py(theset_test_modefixture).autofit/non_linear/analysis/visualize.pyVisualizer.should_visualizesays "If PyAutoFit test mode is on" — naming the product rather than the variable is what leads readers to invent the wrong env var. NamePYAUTO_TEST_MODEexplicitly.Detailed implementation plan
Affected Repositories
Suggested branch:
feature/testmode-env-driftThe bug
test_autocti/aggregator/conftest.py:13-17Why it persisted
autocti_workspace_test/AGENTS.md:42andautocti_assistant/skills/ac_fit_cti_model.md:126already document thatPYAUTOFIT_TEST_MODEdoes 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.jsonallowlists (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/aggregatorgreen with the corrected var.