Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbenav committed May 27, 2024
1 parent 9947083 commit e429618
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/sqlalchemy/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,12 @@ class CardSchema(BaseModel):
)


async def get_session_local():
local_session = sessionmaker(
bind=async_engine, class_=AsyncSession, expire_on_commit=False
)
local_session = sessionmaker(
bind=async_engine, class_=AsyncSession, expire_on_commit=False
)


async def get_session_local():
async with local_session() as session:
yield session
await session.close()
Expand Down
5 changes: 5 additions & 0 deletions tests/sqlmodel/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ class CardSchema(SQLModel):
)


local_session = sessionmaker(
bind=async_engine, class_=AsyncSession, expire_on_commit=False
)


async def get_session_local():
local_session = sessionmaker(bind=async_engine, class_=AsyncSession, expire_on_commit=False)
async with local_session() as session:
Expand Down

0 comments on commit e429618

Please sign in to comment.