import click.testing import pytest import spud.cli @pytest.fixture(autouse=True) def mock_default_config_path(monkeypatch, tmpdir): monkeypatch.setattr( spud.cli, "DEFAULT_CONFIGURATION_PATH", tmpdir / ".config" / "spud" / "config.json", ) @pytest.fixture(name="invoke_cli") def invoke_cli_fixture(): def _call_cli(args: list[str]): runner = click.testing.CliRunner() return runner.invoke(spud.cli.cli, args) return _call_cli