This repository has been archived on 2024-06-02. You can view files and clone it, but cannot push or open issues or pull requests.
spud-py/tests/conftest.py
Marc Cataford be56f287ea
All checks were successful
/ Tests (push) Successful in 45s
/ Static Analysis (push) Successful in 56s
ci: lint + format + test on push
fix: ensure ci lints all source files

chore: formatting
2024-04-13 01:07:26 -04:00

22 lines
488 B
Python

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