Skip to content
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

Use EnvironmentVarGuard in tests instead of manually messing with os.environ #128438

Open
WolframAlph opened this issue Jan 3, 2025 · 0 comments
Labels
tests Tests in the Lib/test dir

Comments

@WolframAlph
Copy link
Contributor

WolframAlph commented Jan 3, 2025

Feature or enhancement

Proposal:

Some tests manually tweak os.environ. There is new way to do that with EnvironmentVarGuard. 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

@WolframAlph WolframAlph added the type-feature A feature request or enhancement label Jan 3, 2025
@WolframAlph WolframAlph changed the title Use EnvironmentVarGuard in test_cmd_line instead of manually messing with os.environ Use EnvironmentVarGuard in tests instead of manually messing with os.environ Jan 3, 2025
@picnixz picnixz added tests Tests in the Lib/test dir and removed type-feature A feature request or enhancement labels Jan 3, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

3 participants