Spaces:
Sleeping
Sleeping
| import pytest | |
| from fastapi.testclient import TestClient | |
| from app.core.config import get_settings | |
| def client(monkeypatch): | |
| monkeypatch.setenv("APP_ENV", "test") # <-- clé du fix | |
| monkeypatch.setenv("API_KEY", "test-key") | |
| get_settings.cache_clear() | |
| from app.main import app | |
| with TestClient(app) as c: | |
| yield c | |
| def auth_headers(): | |
| return {"X-API-Key": "test-key"} |