b9fcf17ae4
Co-Authored-By: Claude <noreply@anthropic.com>
18 lines
513 B
Python
18 lines
513 B
Python
"""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()
|