mirror of
https://github.com/aimingmed/aimingmed-ai.git
synced 2026-01-19 13:23:23 +08:00
22 lines
462 B
Python
22 lines
462 B
Python
import pytest
|
|
from starlette.testclient import TestClient
|
|
|
|
from config import get_settings, Settings
|
|
from main import create_application
|
|
|
|
|
|
def get_settings_override():
|
|
return Settings(testing=1)
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def test_app():
|
|
# set up
|
|
app = create_application()
|
|
app.dependency_overrides[get_settings] = get_settings_override
|
|
with TestClient(app) as test_client:
|
|
# testing
|
|
yield test_client
|
|
|
|
# tear down
|