feat: db base + config tests
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"""Shared pytest fixtures for the yunke-server test suite."""
|
||||
|
||||
import pytest
|
||||
|
||||
from app.config import get_settings
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def reset_settings_cache():
|
||||
"""Ensure each test starts with a fresh Settings cache.
|
||||
|
||||
Tests that mutate env vars and call `get_settings()` must also clear the
|
||||
`lru_cache` themselves; this fixture is a safety net that runs after every
|
||||
test so a cached `Settings` from one test never leaks into the next.
|
||||
"""
|
||||
yield
|
||||
get_settings.cache_clear()
|
||||
Reference in New Issue
Block a user