Use `EnvironmentVarGuard` in tests instead of manually messing with `os.environ`
未關閉
還沒有人認領這個 Issue。
tests
type-feature
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
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
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
在 CPython 測試套件中搜尋手動修改 os.environ 的測試,然後將這些用法與 EnvironmentVarGuard 進行比較。開始之前先檢視連結的 PR(gh-128439、gh-128476、gh-128522、gh-130002 和 gh-131870);當所有適用的手動環境變更都已遷移且受影響的測試通過時,工作就完成了。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- testing
- Issue 類型
- 重構
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100