diff --git a/tests/test_api.py b/tests/test_api.py index 215407f..ab2da49 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,12 +1,18 @@ import importlib import os +import sys import time +from pathlib import Path from typing import Iterator import pymysql import pytest from fastapi.testclient import TestClient +PROJECT_ROOT = Path(__file__).resolve().parents[1] +if str(PROJECT_ROOT) not in sys.path: + sys.path.insert(0, str(PROJECT_ROOT)) + def wait_for_db(host: str, port: int, user: str, password: str, timeout_seconds: int = 60) -> None: deadline = time.time() + timeout_seconds