Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
10 changes: 2 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,15 @@
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"


@pytest.fixture
@pytest.fixture(name="runner")
def runner_setup():
runner = CliRunner()
with runner.isolated_filesystem():
yield runner
yield runner


@pytest.fixture
Expand Down
6 changes: 4 additions & 2 deletions tests/unit_test/test_init_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Loading