Skip to content

Commit 3026ed8

Browse files
author
Curry
committed
test: preserve original rollback for fixture teardown
1 parent 07a2892 commit 3026ed8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎tests/conftest.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ async def db_session(db_engine) -> AsyncGenerator[AsyncSession]:
8383
db_engine, class_=AsyncSession, expire_on_commit=False
8484
)
8585
async with session_factory() as session:
86+
rollback = session.rollback
8687
yield session
87-
await session.rollback()
88+
await rollback()
8889

8990

9091
@pytest_asyncio.fixture(scope="function")

0 commit comments

Comments
 (0)