feat: bootstrap dodo phase one
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client(tmp_path: Path):
|
||||
os.environ["DODO_DATABASE_URL"] = f"sqlite+aiosqlite:///{tmp_path / 'test.db'}"
|
||||
os.environ["DODO_AUTO_CREATE_SCHEMA"] = "true"
|
||||
from backend.config import get_settings
|
||||
get_settings.cache_clear()
|
||||
from backend.db import reset_engine
|
||||
reset_engine()
|
||||
from backend.main import app
|
||||
with TestClient(app) as test_client:
|
||||
yield test_client
|
||||
reset_engine()
|
||||
Reference in New Issue
Block a user