mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-11 21:33:49 +01:00
Tests are now linted by the 10.00 gate (ignore-paths dropped), with no per-test disables. CtlServer/DaemonControl members the tests drive are public (renamed, behaviour unchanged); SteamAPIClient._get takes its params explicitly, as every caller already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
738 B
Python
24 lines
738 B
Python
"""Shared redirect of the config module's on-disk paths for the config tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from contextlib import contextmanager
|
|
from typing import TYPE_CHECKING
|
|
from unittest.mock import patch
|
|
|
|
if TYPE_CHECKING:
|
|
from collections.abc import Iterator
|
|
from pathlib import Path
|
|
|
|
|
|
@contextmanager
|
|
def config_file_under(tmp_path: Path) -> Iterator[Path]:
|
|
"""Point CONFIG_DIR at ``tmp_path/cfg`` and yield its (unwritten) config.json."""
|
|
config_dir = tmp_path / "cfg"
|
|
config_file = config_dir / "config.json"
|
|
with (
|
|
patch("steam_backlog_enforcer.config.CONFIG_DIR", config_dir),
|
|
patch("steam_backlog_enforcer.config.CONFIG_FILE", config_file),
|
|
):
|
|
yield config_file
|