File size: 519 Bytes
058f1d9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import pytest
from fastapi.testclient import TestClient
from main import app
import os
@pytest.fixture()
def app_client():
"""
Barebone test fixture that initializes a FastAPI TestClient
which can be used to test all endpoints provided by the application.
Yields:
TestClient: A client hosting the whole application so that it
can be accessed and controlled programmatically.
"""
os.environ["TEST_MODE"] = "1" # Turns off actual model training
client = TestClient(app)
yield client
|