-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Use EnvironmentVarGuard
in tests instead of manually messing with os.environ
#128438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
EnvironmentVarGuard
in test_cmd_line
instead of manually messing with os.environ
EnvironmentVarGuard
in tests instead of manually messing with os.environ
This was referenced Jan 4, 2025
Merged
gaogaotiantian
pushed a commit
that referenced
this issue
Jan 11, 2025
picnixz
pushed a commit
that referenced
this issue
Jan 15, 2025
#128476) Modifying locale-related environment variables in `Lib/test/test_builtin.py`, `Lib/test/test_io.py` and `Lib/test/test_locale.py` is now achieved by using an `EnvironmentVarGuard` context instead of an explicit `try-finally` block.
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 1, 2025
… manage environment varibales (python#130002)
seehwan
pushed a commit
to seehwan/cpython
that referenced
this issue
Apr 16, 2025
… manage environment varibales (python#130002)
picnixz
pushed a commit
that referenced
this issue
Apr 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Proposal:
Some tests manually tweak
os.environ
. There is new way to do that withEnvironmentVarGuard
. Identify all places and update.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
EnvironmentVarGuard
fortest_urllib
,test_urllib2.py
andurllib2_localnet.py
#128439EnvironmentVarGuard
fortest_builtin.py
,test_io.py
andtest_locale.py
#128476EnvironmentVarGuard
fortest_pdb.py
#128522EnvironmentVarGuard
fordatetimetester.py
to manage environment varibales #130002EnvironmentVarGuard
fortest_zoneinfo.py
to manage environmen… #131870The text was updated successfully, but these errors were encountered: