mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-14 05:14:19 +00:00
* refactor famafrench for v5 * codespell * finishing touches --------- Co-authored-by: deeleeramone <>
29 lines
787 B
Python
29 lines
787 B
Python
"""Shared fixtures for the openbb_famafrench test suite."""
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def vcr_config():
|
|
"""VCR configuration: strip the User-Agent header from recorded cassettes."""
|
|
return {"filter_headers": [("User-Agent", None)]}
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _clear_helper_caches():
|
|
"""Clear helpers' lru_cache wrappers so cached downloads never leak between tests."""
|
|
from openbb_famafrench.utils import helpers
|
|
|
|
cached = (
|
|
helpers.download_file,
|
|
helpers.download_international_portfolios,
|
|
helpers.get_international_portfolio,
|
|
helpers.get_portfolio_data,
|
|
helpers.get_breakpoint_data,
|
|
)
|
|
for fn in cached:
|
|
fn.cache_clear()
|
|
yield
|
|
for fn in cached:
|
|
fn.cache_clear()
|