Skip to content

test: replace deprecated CliRunner.isolated_filesystem with tmp_path (#916) - #917

Open
devpryan7792 wants to merge 1 commit into
simonw:mainfrom
devpryan7792:fix/click-isolated-filesystem-deprecation
Open

devpryan7792 wants to merge 1 commit into
simonw:mainfrom
devpryan7792:fix/click-isolated-filesystem-deprecation

Conversation

@devpryan7792

@devpryan7792 devpryan7792 commented Oct 25, 2026 •

Copy link
Copy Markdown

Click deprecated CliRunner.isolated_filesystem() with plans to remove it in Click 9.0 (DeprecationWarning: 'isolated_filesystem' is deprecated and will be removed in Click 9.0).

This replaces the 22 with runner.isolated_filesystem(): blocks in tests/test_cli.py and tests/test_insert_files.py with pytest's tmp_path fixture and monkeypatch.chdir(tmp_path).

  • All 1,497 tests pass locally with 0 deprecation warnings.
  • Code formatted with black and verified with flake8.

Fixes #916


📚 Documentation preview 📚: https://sqlite-utils--917.org.readthedocs.build/en/917/

@Muguett-DBY Muguett-DBY left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this on Windows with Python 3.12, Click 8.5 and DeprecationWarning treated as an error. In the two changed test files, the base had 32 failures from isolated_filesystem(); this commit has 218 passing and 4 skipped.

I also compared the 22 changed test functions after accounting for the fixture and context-manager replacement. Their remaining test bodies and assertions match the base. I used Codex for the comparison; this was a focused check of the two files, not a full-suite or non-Windows run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants