Skip to content

fix: treat test mode zero as disabled#1326

Open
Jammy2211 wants to merge 1 commit into
mainfrom
feature/aggregator-output-contracts
Open

fix: treat test mode zero as disabled#1326
Jammy2211 wants to merge 1 commit into
mainfrom
feature/aggregator-output-contracts

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Treat the documented PYAUTO_TEST_MODE=0 value as disabled when composing search output paths. This keeps release-profile searches in the normal output tree while preserving output/test_mode/ isolation for active test levels.

API Changes

DirectoryPaths now treats PYAUTO_TEST_MODE=0 the same as an unset variable. Active levels 1, 2, and 3 continue to add the test_mode output segment.
See full details below.

Test Plan

  • python -m pytest test_autofit/ -x — 1422 passed, 14 skipped
  • Clean release-profile Nautilus run writes to output/results_folder/
  • PYAUTO_TEST_MODE=2 remains covered by path tests
Full API Changes (for automation & release notes)

Removed

  • None.

Added

  • None.

Renamed

  • None.

Changed Signature

  • None.

Changed Behaviour

  • autofit.DirectoryPaths.output_pathPYAUTO_TEST_MODE=0 no longer inserts a test_mode path segment; only active test-mode levels do.

Migration

  • None required. Existing active test-mode paths are unchanged.

🤖 Generated with Codex

Copilot AI review requested due to automatic review settings July 6, 2026 20:24
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates DirectoryPaths output-path composition so that the documented PYAUTO_TEST_MODE=0 value is treated as “disabled” (equivalent to the env var being unset). This keeps normal runs writing into the standard output tree while preserving output/test_mode/... isolation for active test modes.

Changes:

  • Switch test-mode path segmentation from a raw env-var truthiness check to autoconf.test_mode.is_test_mode(), so "0" no longer activates the test_mode segment.
  • Update path-related docstrings to refer to “active” test mode.
  • Add a regression test ensuring PYAUTO_TEST_MODE="0" does not insert the test_mode output segment.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
autofit/non_linear/paths/abstract.py Uses is_test_mode() to decide whether to insert the test_mode output-path segment, fixing "0" being incorrectly treated as enabled.
test_autofit/non_linear/paths/test_paths.py Adds a regression test asserting PYAUTO_TEST_MODE=0 excludes the test_mode segment in output_path.

Comment on lines +28 to +29
Returns ``"test_mode"`` when ``PYAUTO_TEST_MODE`` is active, else
``None``.
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants