gh-150046: Fix test_add_python_opts to ignore PYTHON* vars#150089
Merged
Conversation
Avoid the runtime environment from affecting the tests' behaviours, which notably checks the warning filters which can be controlled by various environment variables.
vstinner
reviewed
May 19, 2026
This reverts commit fb82f0c.
-E to subprocesses from check_add_python_optstest_add_python_opts to ignore PYTHON* vars
Member
Author
|
Sorry that took a while -- turns out, doing an 8 hour timezone jump is a great way to be knocked out. 😅 |
vstinner
approved these changes
May 28, 2026
Member
vstinner
left a comment
There was a problem hiding this comment.
LGTM.
PYTHONDEVMODE=1 ./python -m test test_regrtest -m test_add_python_opts -v fails without this change, and pass with this change.
|
Thanks @pradyunsg for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-150561 is a backport of this pull request to the 3.15 branch. |
|
GH-150562 is a backport of this pull request to the 3.14 branch. |
|
GH-150563 is a backport of this pull request to the 3.13 branch. |
Member
|
I merged and backported your PR. Thanks for your fix! |
vstinner
pushed a commit
that referenced
this pull request
May 28, 2026
…vars (GH-150089) (#150563) gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (GH-150089) Avoid the runtime environment from affecting the tests' behaviours, which notably checks the warning filters which can be controlled by various PYTHON environment variables. (cherry picked from commit ef2246f) Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
vstinner
pushed a commit
that referenced
this pull request
May 28, 2026
…vars (GH-150089) (#150562) gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (GH-150089) Avoid the runtime environment from affecting the tests' behaviours, which notably checks the warning filters which can be controlled by various PYTHON environment variables. (cherry picked from commit ef2246f) Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
vstinner
pushed a commit
that referenced
this pull request
May 28, 2026
…vars (GH-150089) (#150561) gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (GH-150089) Avoid the runtime environment from affecting the tests' behaviours, which notably checks the warning filters which can be controlled by various PYTHON environment variables. (cherry picked from commit ef2246f) Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
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.
Avoid the runtime environment from affecting the tests' behaviours, which checks the warning filters. The filters can be affected by various
PYTHON*environment variables.test_add_python_optsfails when executed withPYTHONDEVMODE=1in the environment #150046