ref: Use AsyncSession in some tests (#5151)
This commit is contained in:
parent
f97a326023
commit
624a2dde5d
7 changed files with 53 additions and 47 deletions
|
|
@ -74,7 +74,7 @@ def session_getter(db_service: DatabaseService):
|
|||
@asynccontextmanager
|
||||
async def async_session_getter(db_service: DatabaseService):
|
||||
try:
|
||||
session = AsyncSession(db_service.async_engine)
|
||||
session = AsyncSession(db_service.async_engine, expire_on_commit=False)
|
||||
yield session
|
||||
except Exception:
|
||||
logger.exception("Session rollback because of exception")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue