mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
pre-review tidyup
This commit is contained in:
parent
a1dba64e51
commit
33a237104c
2 changed files with 2 additions and 6 deletions
|
|
@ -22,8 +22,6 @@ from backend.app.db.models.tasks import SourceEnum, Task, SubTask
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
|
|
||||||
# from sqlmodel import Session, select
|
|
||||||
|
|
||||||
|
|
||||||
router = APIRouter(
|
router = APIRouter(
|
||||||
prefix="/tasks",
|
prefix="/tasks",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ def engine(postgresql):
|
||||||
engine = create_engine(connection_string)
|
engine = create_engine(connection_string)
|
||||||
|
|
||||||
# Create tables once per test session
|
# Create tables once per test session
|
||||||
# Base.metadata.create_all(engine)
|
Base.metadata.create_all(engine)
|
||||||
|
SQLModel.metadata.create_all(engine)
|
||||||
|
|
||||||
# Yeild will split this function into two phase. 1) setup and 2) teardown, the latter of which will run after all
|
# Yeild will split this function into two phase. 1) setup and 2) teardown, the latter of which will run after all
|
||||||
# tests have completed
|
# tests have completed
|
||||||
|
|
@ -47,9 +48,6 @@ def db_session(engine):
|
||||||
connection = engine.connect()
|
connection = engine.connect()
|
||||||
transaction = connection.begin()
|
transaction = connection.begin()
|
||||||
|
|
||||||
Base.metadata.create_all(bind=connection)
|
|
||||||
SQLModel.metadata.create_all(bind=connection)
|
|
||||||
|
|
||||||
session = sessionmaker(bind=connection)()
|
session = sessionmaker(bind=connection)()
|
||||||
|
|
||||||
yield session
|
yield session
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue