Skip to content

Commit 4ba6184

Browse files
committed
small fixes
1 parent b3300f6 commit 4ba6184

File tree

1 file changed

+1
-13
lines changed
  • exmaples/fastapi_example/tests/transactional

1 file changed

+1
-13
lines changed

exmaples/fastapi_example/tests/transactional/conftest.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import pytest_asyncio
1616

17-
from sqlalchemy.ext.asyncio import async_sessionmaker, AsyncSession
17+
from sqlalchemy.ext.asyncio import AsyncSession
1818

1919
from exmaples.fastapi_example.database import master
2020
from context_async_sqlalchemy import (
@@ -24,18 +24,6 @@
2424
)
2525

2626

27-
@pytest_asyncio.fixture
28-
async def db_session_test(
29-
session_maker_test: async_sessionmaker[AsyncSession],
30-
) -> AsyncGenerator[AsyncSession]:
31-
"""The session that is used inside the test"""
32-
async with session_maker_test() as session:
33-
try:
34-
yield session
35-
finally:
36-
await session.rollback()
37-
38-
3927
@pytest_asyncio.fixture(autouse=True)
4028
async def db_session_override(
4129
db_session_test: AsyncSession,

0 commit comments

Comments
 (0)