feat: Datenmodell (SQLAlchemy) und Alembic-Migration
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
17
finance/tests/conftest.py
Normal file
17
finance/tests/conftest.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import pytest
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.pool import StaticPool
|
||||
|
||||
from app.db import Base
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def db():
|
||||
engine = create_engine(
|
||||
"sqlite://", poolclass=StaticPool,
|
||||
connect_args={"check_same_thread": False},
|
||||
)
|
||||
Base.metadata.create_all(engine)
|
||||
with Session(engine) as session:
|
||||
yield session
|
||||
Reference in New Issue
Block a user