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
|
|
@ -24,7 +24,7 @@ async def session():
|
|||
engine = create_async_engine("sqlite+aiosqlite:///:memory:")
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(SQLModel.metadata.create_all)
|
||||
async with AsyncSession(engine) as session:
|
||||
async with AsyncSession(engine, expire_on_commit=False) as session:
|
||||
yield session
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue