mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2026-01-17 11:40:39 +03:00
refactor: remove unnecessary await from database session commit in client fixture
This commit is contained in:
@@ -80,14 +80,13 @@ async def db_session():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
async def client(db_session) -> AsyncGenerator[AsyncClient, Any]: # noqa: ARG001
|
async def client(db_session) -> AsyncGenerator[AsyncClient, Any]:
|
||||||
transport = ASGITransport(
|
transport = ASGITransport(
|
||||||
app=app,
|
app=app,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def override_get_db():
|
async def override_get_db():
|
||||||
yield db_session
|
yield db_session
|
||||||
await db_session.commit()
|
|
||||||
|
|
||||||
async with AsyncClient(
|
async with AsyncClient(
|
||||||
base_url="http://testserver/v1",
|
base_url="http://testserver/v1",
|
||||||
|
|||||||
Reference in New Issue
Block a user