Tests use CliRunner.isolated_filesystem(), which is deprecated and will be removed in Click 9.0

オープン 初心者向け
#916 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@devpryan7792 がすでに取り組んでいます。

2026年10月25日 から。

  • #917 @devpryan7792 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli, testing

調査の方向性

まず tests/test_cli.py と tests/test_insert_files.py で isolated_filesystem() を検索します。issue には22件の呼び出しと影響を受けるテストが記載されています。これらのテストで相対パスをどのように使用しているかを読み、必要に応じて pytest のフィクスチャ 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

simonw/sqlite-utils のほかの issue

simonw/sqlite-utils の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。