Spaces:
Sleeping
Sleeping
| from __future__ import annotations | |
| import os | |
| from pathlib import Path | |
| import pytest | |
| from fastapi.testclient import TestClient | |
| from src.app import app | |
| from src.db.sqlite_db import init_db | |
| def isolate_db(tmp_path: Path): | |
| old_cwd = os.getcwd() | |
| os.chdir(tmp_path) | |
| init_db() | |
| yield | |
| os.chdir(old_cwd) | |
| def client() -> TestClient: | |
| return TestClient(app) | |