Spaces:
Running
Running
File size: 564 Bytes
c20d7c0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | """Test fixtures for the stock data API service."""
import os
import pytest
from fastapi.testclient import TestClient
# Disable cache and API key for testing
os.environ["CACHE_ENABLED"] = "false"
os.environ["STOCK_DATA_API_KEY"] = "test-key"
os.environ["DATABASE_URL"] = "sqlite:///./.cache/test.db"
@pytest.fixture
def client():
"""Create a test client for the FastAPI app."""
from app.main import app
return TestClient(app)
@pytest.fixture
def auth_headers():
"""Return headers with valid API key."""
return {"X-API-Key": "test-key"}
|