Tests use CliRunner.isolated_filesystem(), which is deprecated and will be removed in Click 9.0
維護者通常 3 天內回覆
評估
研究方向
先在 tests/test_cli.py 和 tests/test_insert_files.py 中搜尋 isolated_filesystem();issue 列出 22 個呼叫和受影響的測試。閱讀這些測試如何使用相對路徑,然後視需要使用 pytest 的 fixture tmp_path,或切換到該目錄。執行測試套件,並確認它在沒有這些棄用警告的情況下通過。
由索引模型根據 Issue 內容生成。
描述
Running the test suite produces 33 DeprecationWarnings from Click:
DeprecationWarning: 'isolated_filesystem' is deprecated and will be removed in Click 9.0. Use 'tempfile.TemporaryDirectory' or pytest's 'tmp_path' fixture with absolute paths instead.
Once Click 9.0 is released, these tests will fail, since sqlite-utils doesn't pin Click below 9.
Steps to reproduce
git clone https://github.com/simonw/sqlite-utils
cd sqlite-utils
uv run pytest
Expected
Test suite passes with no deprecation warnings from the project's own tests.
Actual
1497 passed, 16 skipped, 33 warnings — all 33 warnings are the isolated_filesystem deprecation.
Affected code
22 with runner.isolated_filesystem(): calls (33 test runs once parametrization is counted):
tests/test_cli.py— 19 calls (e.g.test_create_table,test_create_view,test_drop_table,test_enable_wal,test_create_table_strict)tests/test_insert_files.py— 3 calls (test_insert_files,test_insert_files_stdin,test_insert_files_bad_text_encoding_error)
Find them with: grep -n isolated_filesystem tests/*.py
Suggested fix
Replace runner.isolated_filesystem() with pytest's tmp_path fixture (or monkeypatch.chdir(tmp_path) where tests rely on relative paths), as the warning recommends.
Environment
- macOS (Apple Silicon)
- Python 3.13.5 (via uv 0.13.5)
- sqlite-utils 4.2.1, commit [YOUR HASH]
- pytest 9.1.1
- 主要語言
- Python
- 星號
- 2.2k
- 分支
- 215
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
simonw/sqlite-utils 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
simonw/sqlite-utils#928 ·
維護者通常 3 天內回覆
-
rows_from_file() splits a single-column CSV file on a letter, or raises csv.Error可能已有人在做 @L4XB 於 20 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
simonw/sqlite-utils#907 ·
維護者通常 3 天內回覆
-
enable_fts() exhausts iterator columns before populating the index可能已有人在做 @syahra712 於 25 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 83/100
simonw/sqlite-utils#902 ·
維護者通常 3 天內回覆
-
rows_from_file() ignores ignore_extras= and extras_key= for anything that isn't Format.CSV可能已有人在做 @feiiiiii5 於 37 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
simonw/sqlite-utils#892 ·
維護者通常 3 天內回覆
-
Raw numpy scalar values get silently stored as corrupted BLOBs instead of being converted可能已有人在做 @TanbirRamim 於 44 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
simonw/sqlite-utils#876 ·
維護者通常 3 天內回覆
查看 simonw/sqlite-utils 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 64/100
FinanceFlash/unvibecode#577 · 1 則留言 ·
維護者通常 1 天內回覆
-
area/test type/bug
難度 2/5 1-3 小時 新手友好度 76/100
Clodmony/starship-coop#70 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
punitarani/fli#270 ·
-
🐛 Bug 🔔 Pending processing
難度 2/5 1-3 小時 新手友好度 67/100
jumpserver/jumpserver#17980 ·
維護者通常 1 天內回覆
-
community enhancement good first issue
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆