Skip to content

fix: delete dead PYAUTOFIT_TEST_MODE fixture in aggregator conftest - #96

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/testmode-env-drift
Jul 22, 2026
Merged

fix: delete dead PYAUTOFIT_TEST_MODE fixture in aggregator conftest#96
Jammy2211 merged 1 commit into
mainfrom
feature/testmode-env-drift

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Closes #95.

What

Deletes the autouse set_test_mode fixture in test_autocti/aggregator/conftest.py, which set PYAUTOFIT_TEST_MODE — a variable nothing in the stack reads. The canonical knob is PYAUTO_TEST_MODE (PyAutoNerves/autonerves/test_mode.py:14). The fixture has always been a silent no-op.

Why delete rather than rename

Renaming it to the live variable looks like the obvious fix, but it is wrong — it makes test mode genuinely take effect, which bypasses sampling, so the aggregator has no samples to iterate and 6 of 13 tests fail. These tests were written against, and only pass under, normal sampling.

Verified 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 (this PR) 13 passed

So deletion is behaviour-preserving and removes the trap outright.

pytest and os remain used elsewhere in the file, so no import changes.

Context

autocti_workspace_test/AGENTS.md:42 and autocti_assistant/skills/ac_fit_cti_model.md:126 already documented that PYAUTOFIT_TEST_MODE does not exist. The trap was documented instead of deleted; this deletes it.

Companion docstring fix in PyAutoFit names PYAUTO_TEST_MODE explicitly (that prose is what invites the wrong name).

)

The autouse `set_test_mode` fixture set `PYAUTOFIT_TEST_MODE`, which nothing
reads — the canonical knob is `PYAUTO_TEST_MODE` (autonerves/test_mode.py).
The fixture has therefore always been a silent no-op.

Renaming it to the live variable is NOT the right fix: it makes test mode
actually take effect, which bypasses sampling so the aggregator has no samples
to iterate, and 6 of the 13 aggregator tests fail. These tests were written
against — and only pass under — normal sampling.

Verified three ways:
  dead var present (baseline) -> 13 passed
  renamed to PYAUTO_TEST_MODE -> 6 failed, 7 passed
  fixture deleted (this fix)  -> 13 passed

So the fixture is deleted rather than renamed: behaviour-preserving, and it
removes a trap that autocti_workspace_test/AGENTS.md and autocti_assistant
had resorted to documenting instead of deleting.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JiU4VbBD9X6jPYJMCx3boh
@Jammy2211
Jammy2211 merged commit 4e4447e into main Jul 22, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/testmode-env-drift branch July 22, 2026 19:18
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.

fix: PYAUTOFIT_TEST_MODE is a dead env var — aggregator test-mode fixture is a silent no-op

1 participant