This commit is contained in:
@@ -6,6 +6,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from app.db import SessionLocal, configure_database
|
||||
from app.main import create_app
|
||||
from app.migrate import run_migrations
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -13,6 +14,9 @@ def client(tmp_path: Path):
|
||||
test_db_path = tmp_path / "test.db"
|
||||
database_url = f"sqlite:///{test_db_path}"
|
||||
|
||||
# Run migration first so DB is at head before app starts.
|
||||
run_migrations(database_url)
|
||||
|
||||
configure_database(database_url)
|
||||
app = create_app()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user