Skip to content

gh-150046: Fix test_add_python_opts to ignore PYTHON* vars#150089

Merged
vstinner merged 5 commits into
python:mainfrom
pradyunsg:fixup-test_add_python_opts
May 28, 2026
Merged

gh-150046: Fix test_add_python_opts to ignore PYTHON* vars#150089
vstinner merged 5 commits into
python:mainfrom
pradyunsg:fixup-test_add_python_opts

Conversation

@pradyunsg
Copy link
Copy Markdown
Member

@pradyunsg pradyunsg commented May 19, 2026

Avoid the runtime environment from affecting the tests' behaviours, which checks the warning filters. The filters can be affected by various PYTHON* environment variables.

Avoid the runtime environment from affecting the tests' behaviours,
which notably checks the warning filters which can be controlled by
various environment variables.
@pradyunsg pradyunsg requested a review from vstinner May 19, 2026 15:04
@pradyunsg pradyunsg added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels May 19, 2026
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label May 19, 2026
Comment thread Misc/NEWS.d/next/Tests/2026-05-19-08-10-20.gh-issue-150046.MndDD8.rst Outdated
Comment thread Lib/test/test_regrtest.py Outdated
@pradyunsg pradyunsg changed the title gh-150046: Pass -E to subprocesses from check_add_python_opts gh-150046: Fix test_add_python_opts to ignore PYTHON* vars May 21, 2026
@pradyunsg
Copy link
Copy Markdown
Member Author

Sorry that took a while -- turns out, doing an 8 hour timezone jump is a great way to be knocked out. 😅

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

PYTHONDEVMODE=1 ./python -m test test_regrtest -m test_add_python_opts -v fails without this change, and pass with this change.

@vstinner vstinner merged commit ef2246f into python:main May 28, 2026
53 checks passed
@miss-islington-app
Copy link
Copy Markdown

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.
🐍🍒⛏🤖

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 28, 2026

GH-150561 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label May 28, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 28, 2026

GH-150562 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label May 28, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 28, 2026

GH-150563 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label May 28, 2026
@vstinner
Copy link
Copy Markdown
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants