Use `EnvironmentVarGuard` in tests instead of manually messing with `os.environ`
Open
Nobody has claimed this yet.
tests
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
- gh-128439
- gh-128476
- gh-128522
- gh-130002
- gh-131870
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the CPython test suite for tests that manually modify os.environ, then compare those uses with EnvironmentVarGuard. Review the linked PRs (gh-128439, gh-128476, gh-128522, gh-130002, and gh-131870) before starting; the work is done when all applicable manual environment changes have been migrated and the affected tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100