mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-10 18:07:07 +01:00
tests: cmd_stats tests no longer hit the network
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / web-coverage (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / web-coverage (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWxdzckyBH7fEbPywpr
This commit is contained in:
parent
2e66502abc
commit
bfa4a6260f
@ -2,8 +2,11 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from steam_backlog_enforcer._stats import (
|
||||
_GameTimes,
|
||||
cmd_stats,
|
||||
@ -12,9 +15,20 @@ from steam_backlog_enforcer.config import Config, State
|
||||
from steam_backlog_enforcer.protondb import ProtonDBRating
|
||||
from steam_backlog_enforcer.steam_api import GameInfo
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Iterator
|
||||
|
||||
_PKG = "steam_backlog_enforcer._stats"
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _no_live_refresh() -> Iterator[None]:
|
||||
"""cmd_stats must not hit Steam or HLTB: unmocked, each test cost ~2 s."""
|
||||
refresh = f"{_PKG}._refresh_recently_played_completions"
|
||||
with patch(refresh, lambda g, _c: g), patch(f"{_PKG}._print_worst_example"):
|
||||
yield
|
||||
|
||||
|
||||
def _game(
|
||||
app_id: int = 1,
|
||||
name: str = "G",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user