kneifftools / tests /conftest.py
kneiff's picture
chore(history)!: publish anonymous repository root
2857cf3
Raw
History Blame Contribute Delete
969 Bytes
"""Shared pytest fixtures for isolated runtime configuration."""
from pathlib import Path
import pytest
from tests._cli_helpers import set_test_project_storage, set_test_storage
@pytest.fixture
def isolated_cli_storage(
monkeypatch: pytest.MonkeyPatch,
tmp_path: Path,
) -> Path:
"""Select a per-test AppRC storage for runtimeful CLI commands.
:param monkeypatch: Pytest environment patching helper.
:param tmp_path: Per-test temporary directory.
:return: Selected storage root.
"""
return set_test_storage(monkeypatch, tmp_path)
@pytest.fixture
def isolated_cli_project(
monkeypatch: pytest.MonkeyPatch,
tmp_path: Path,
) -> Path:
"""Select a temporary storage containing the shallow Kneiff scaffold.
:param monkeypatch: Pytest environment patching helper.
:param tmp_path: Per-test temporary directory.
:return: Selected project root.
"""
return set_test_project_storage(monkeypatch, tmp_path)