3 endpoint cache 적용 — /api/webai/portfolio, /api/webai/news-sentiment, /api/stock/screener/run (preview 모드만, auto는 캐시 미적용). V1+V2 동시 호출도 NAS에서 1회 계산. web-ai 측 SP-A1 캐시와 2-layer로 작동하여 NAS 인바운드 부담 70% 감소 예상. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16 lines
410 B
Python
16 lines
410 B
Python
"""Project-level pytest conftest.
|
|
|
|
SP-A2: autouse fixture that resets all webai_cache TTLCaches between tests
|
|
so screener/portfolio/news cache state does not leak across test cases.
|
|
"""
|
|
import pytest
|
|
from app import webai_cache
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _reset_webai_cache():
|
|
webai_cache.PORTFOLIO_CACHE.clear()
|
|
webai_cache.NEWS_CACHE.clear()
|
|
webai_cache.SCREENER_CACHE.clear()
|
|
yield
|