Skip to content

Commit 259ae7b

Browse files
committed
chore: fix testing infrastructure inconsistencies
- Add pytestmark = pytest.mark.unit to test_file_config.py, test_cachekitio_config.py, test_cachekitio_error_handler.py for consistency with other unit backend tests - Remove unused monkeypatch parameter from file backend critical test fixture - Fix stale docstrings in critical conftest
1 parent 7275e70 commit 259ae7b

5 files changed

Lines changed: 9 additions & 3 deletions

File tree

tests/critical/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Pytest configuration for critical path tests.
22
3-
Override autouse fixtures that aren't needed for FileBackend/MemcachedBackend tests.
3+
Override autouse fixtures that aren't needed for non-Redis backend tests.
44
"""
55

66

77
def pytest_runtest_setup(item):
8-
"""Skip redis setup for file backend and cachekitio metrics tests."""
8+
"""Skip redis setup for non-Redis backend critical tests."""
99
skip_redis = (
1010
"file_backend" in item.nodeid
1111
or "cachekitio_metrics" in item.nodeid

tests/critical/test_file_backend_critical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
@pytest.fixture
22-
def backend(tmp_path, monkeypatch):
22+
def backend(tmp_path):
2323
"""Create FileBackend instance for testing.
2424
2525
Uses tmp_path fixture to isolate cache directory per test.

tests/unit/backends/test_cachekitio_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
is_private_ip,
1010
)
1111

12+
pytestmark = pytest.mark.unit
13+
1214

1315
class TestIsPrivateIP:
1416
"""Tests for is_private_ip function."""

tests/unit/backends/test_cachekitio_error_handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from cachekit.backends.cachekitio.error_handler import classify_http_error
77
from cachekit.backends.errors import BackendError, BackendErrorType
88

9+
pytestmark = pytest.mark.unit
10+
911

1012
def _response(status_code: int) -> httpx.Response:
1113
return httpx.Response(status_code=status_code, request=httpx.Request("GET", "http://test"))

tests/unit/backends/test_file_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
from cachekit.backends.file.config import FileBackendConfig
1818

19+
pytestmark = pytest.mark.unit
20+
1921

2022
class TestFileBackendConfigDefaults:
2123
"""Test default configuration values."""

0 commit comments

Comments
 (0)