fix: treat test mode zero as disabled#1326
Open
Jammy2211 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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 thetest_modesegment. - Update path-related docstrings to refer to “active” test mode.
- Add a regression test ensuring
PYAUTO_TEST_MODE="0"does not insert thetest_modeoutput 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``. |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Treat the documented
PYAUTO_TEST_MODE=0value as disabled when composing search output paths. This keeps release-profile searches in the normal output tree while preservingoutput/test_mode/isolation for active test levels.API Changes
DirectoryPathsnow treatsPYAUTO_TEST_MODE=0the same as an unset variable. Active levels1,2, and3continue to add thetest_modeoutput segment.See full details below.
Test Plan
python -m pytest test_autofit/ -x— 1422 passed, 14 skippedoutput/results_folder/PYAUTO_TEST_MODE=2remains covered by path testsFull API Changes (for automation & release notes)
Removed
Added
Renamed
Changed Signature
Changed Behaviour
autofit.DirectoryPaths.output_path—PYAUTO_TEST_MODE=0no longer inserts atest_modepath segment; only active test-mode levels do.Migration
🤖 Generated with Codex