From 936e48f3cc9af93b8df4547170efaf41786489c8 Mon Sep 17 00:00:00 2001 From: phalberg Date: Sun, 9 Aug 2026 13:32:04 +0200 Subject: [PATCH 1/3] chore: dummy commit --- tests/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/conftest.py b/tests/conftest.py index ed27975..11bbb02 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,6 +18,7 @@ def fixture_dir(): @pytest.fixture def runner_setup(): runner = CliRunner() + # TODO: remove and perhaps add tmp_path to use instead? with runner.isolated_filesystem(): yield runner From cfdaa63e9587e02d30ff98f65afaf869b95b08cf Mon Sep 17 00:00:00 2001 From: phalberg Date: Sun, 16 Aug 2026 11:40:57 +0200 Subject: [PATCH 2/3] chore: remove redudant old debugging statement --- tests/conftest.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 11bbb02..518ca82 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,11 +5,6 @@ from typer.testing import CliRunner -def output_debugging(result): - print(result.exception) - print(result.exit_code) - - @pytest.fixture def fixture_dir(): yield Path(__file__).resolve().parent / "test_files" From 62b08b5502431d9686bbd8ec044cc78d8d2d987a Mon Sep 17 00:00:00 2001 From: phalberg Date: Sun, 16 Aug 2026 15:50:57 +0200 Subject: [PATCH 3/3] chore: start adding tmp_path for isolated_filesystem cases --- config.lock.json => metadata.lock.json | 0 tests/conftest.py | 6 ++---- tests/unit_test/test_init_command.py | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename config.lock.json => metadata.lock.json (100%) diff --git a/config.lock.json b/metadata.lock.json similarity index 100% rename from config.lock.json rename to metadata.lock.json diff --git a/tests/conftest.py b/tests/conftest.py index 518ca82..c416e47 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,12 +10,10 @@ def fixture_dir(): yield Path(__file__).resolve().parent / "test_files" -@pytest.fixture +@pytest.fixture(name="runner") def runner_setup(): runner = CliRunner() - # TODO: remove and perhaps add tmp_path to use instead? - with runner.isolated_filesystem(): - yield runner + yield runner @pytest.fixture diff --git a/tests/unit_test/test_init_command.py b/tests/unit_test/test_init_command.py index 8e9554a..73cbbf4 100644 --- a/tests/unit_test/test_init_command.py +++ b/tests/unit_test/test_init_command.py @@ -47,10 +47,12 @@ def test_init_path_already_exits(runner_with_lock_file_setup): ], ids=["ValueError path error", "ValueError unsupported file"], ) -def test_init_not_possible_operations(input_arg, expected_text, runner_setup): +def test_init_not_possible_operations(input_arg, expected_text, runner, tmp_path): - result = runner_setup.invoke(cli.app, ["init", input_arg]) + path = tmp_path / input_arg + result = runner.invoke(cli.app, ["init", str(path)]) + assert not path.exists() assert result.exit_code == 1 assert isinstance(result.exception, ValueError) assert expected_text in str(result.exception).lower()