From e9d0611942d76aba3414b262d5ea0f6d69603c16 Mon Sep 17 00:00:00 2001 From: jross Date: Mon, 8 Jun 2026 11:47:01 -0600 Subject: [PATCH 1/2] test: use tmp_path instead of removed CliRunner.isolated_filesystem Click's CliRunner dropped the isolated_filesystem() context manager in the version now resolved, so test_associate_assets_command_calls_service failed with AttributeError. Replace it with the pytest tmp_path fixture, matching the pattern used by other tests in this file. Co-Authored-By: Claude Opus 4.7 --- tests/test_cli_commands.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_cli_commands.py b/tests/test_cli_commands.py index bc9ff031..3832dd61 100644 --- a/tests/test_cli_commands.py +++ b/tests/test_cli_commands.py @@ -254,7 +254,7 @@ def fake_initializer(): assert called["count"] == 1 -def test_associate_assets_command_calls_service(monkeypatch): +def test_associate_assets_command_calls_service(monkeypatch, tmp_path): captured = {} def fake_associate(source_directory): @@ -263,13 +263,11 @@ def fake_associate(source_directory): monkeypatch.setattr("cli.service_adapter.associate_assets", fake_associate) - runner = CliRunner() - with runner.isolated_filesystem(): - workdir = Path.cwd() - asset_dir = workdir / "asset_import_batch" - asset_dir.mkdir() + asset_dir = tmp_path / "asset_import_batch" + asset_dir.mkdir() - result = runner.invoke(cli, ["associate-assets", str(asset_dir)]) + runner = CliRunner() + result = runner.invoke(cli, ["associate-assets", str(asset_dir)]) assert result.exit_code == 0, result.output assert captured["path"] == asset_dir @@ -703,10 +701,12 @@ def _write_csv(path: Path, *, well_name: str, notes: str): "Water level accurate to within two hundreths of a foot," f"{notes}" ) - csv_text = textwrap.dedent(f"""\ + csv_text = textwrap.dedent( + f"""\ {header} {row} - """) + """ + ) path.write_text(csv_text) unique_notes = f"pytest-{uuid.uuid4()}" From 515122c24465a120d41b8990d658aacc85f65336 Mon Sep 17 00:00:00 2001 From: jirhiker <2035568+jirhiker@users.noreply.github.com> Date: Mon, 8 Jun 2026 17:47:39 +0000 Subject: [PATCH 2/2] Formatting changes --- tests/test_cli_commands.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_cli_commands.py b/tests/test_cli_commands.py index 3832dd61..5953c0f2 100644 --- a/tests/test_cli_commands.py +++ b/tests/test_cli_commands.py @@ -701,12 +701,10 @@ def _write_csv(path: Path, *, well_name: str, notes: str): "Water level accurate to within two hundreths of a foot," f"{notes}" ) - csv_text = textwrap.dedent( - f"""\ + csv_text = textwrap.dedent(f"""\ {header} {row} - """ - ) + """) path.write_text(csv_text) unique_notes = f"pytest-{uuid.uuid4()}"