File tree Expand file tree Collapse file tree 9 files changed +9
-9
lines changed
fastapi_with_pure_asgi_example/tests Expand file tree Collapse file tree 9 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1717@asynccontextmanager
1818async def rollback_session (
1919 connection : DBConnect ,
20- ) -> AsyncGenerator [AsyncSession ]:
20+ ) -> AsyncGenerator [AsyncSession , None ]:
2121 """A session that always rolls back"""
2222 session_maker = await connection .session_maker ()
2323 async with session_maker () as session :
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ <h3 id="rollback_session">rollback_session</h3>
379379< pre > < code class ="language-python "> @asynccontextmanager
380380async def rollback_session(
381381 connection: DBConnect,
382- ) -> AsyncGenerator[AsyncSession]:
382+ ) -> AsyncGenerator[AsyncSession, None ]:
383383</ code > </ pre >
384384< p > A context manager that creates a session which is automatically rolled
385385back at the end.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ <h2 id="create-session-with-autorollback">Create session with autorollback</h2>
153153< pre > < code class ="language-python "> from context_async_sqlalchemy.test_utils import rollback_session
154154
155155@pytest_asyncio.fixture
156- async def db_session_test() -> AsyncGenerator[AsyncSession]:
156+ async def db_session_test() -> AsyncGenerator[AsyncSession, None ]:
157157 """The session that is used inside the test"""
158158 async with rollback_session(connection) as session:
159159 yield session
Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ You can read more about testing here: [Testing](testing.md)
306306@asynccontextmanager
307307async def rollback_session (
308308 connection : DBConnect,
309- ) -> AsyncGenerator[AsyncSession]:
309+ ) -> AsyncGenerator[AsyncSession, None ]:
310310```
311311A context manager that creates a session which is automatically rolled
312312back at the end.
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ application and the tests.](https://github.com/krylosov-aa/context-async-sqlalch
6868from context_async_sqlalchemy.test_utils import rollback_session
6969
7070@pytest_asyncio.fixture
71- async def db_session_test () -> AsyncGenerator[AsyncSession]:
71+ async def db_session_test () -> AsyncGenerator[AsyncSession, None ]:
7272 """ The session that is used inside the test"""
7373 async with rollback_session(connection) as session:
7474 yield session
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ async def client(app: FastAPI) -> AsyncGenerator[AsyncClient]:
3737
3838
3939@pytest_asyncio .fixture
40- async def db_session_test () -> AsyncGenerator [AsyncSession ]:
40+ async def db_session_test () -> AsyncGenerator [AsyncSession , None ]:
4141 """The session that is used inside the test"""
4242 async with rollback_session (connection ) as session :
4343 yield session
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ async def client(app: FastAPI) -> AsyncGenerator[AsyncClient]:
3737
3838
3939@pytest_asyncio .fixture
40- async def db_session_test () -> AsyncGenerator [AsyncSession ]:
40+ async def db_session_test () -> AsyncGenerator [AsyncSession , None ]:
4141 """The session that is used inside the test"""
4242 async with rollback_session (connection ) as session :
4343 yield session
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ async def client(app: Starlette) -> AsyncGenerator[AsyncClient]:
3737
3838
3939@pytest_asyncio .fixture
40- async def db_session_test () -> AsyncGenerator [AsyncSession ]:
40+ async def db_session_test () -> AsyncGenerator [AsyncSession , None ]:
4141 """The session that is used inside the test"""
4242 async with rollback_session (connection ) as session :
4343 yield session
You can’t perform that action at this time.
0 commit comments