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