Simplified workflows.
Signed-off-by: Pavel Kirilin <s3riussan@gmail.com>
This commit is contained in:
+4
-2
@@ -10,6 +10,7 @@ from piccolo.table import create_tables, drop_tables
|
||||
|
||||
from zangramru.settings import settings
|
||||
from zangramru.web.application import get_app
|
||||
from zangramru.web.lifespan import lifespan_setup
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -73,14 +74,15 @@ async def setup_db() -> AsyncGenerator[None, None]:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def fastapi_app() -> FastAPI:
|
||||
async def fastapi_app() -> AsyncGenerator[FastAPI, None]:
|
||||
"""
|
||||
Fixture for creating FastAPI app.
|
||||
|
||||
:return: fastapi app with mocked dependencies.
|
||||
"""
|
||||
application = get_app()
|
||||
return application # noqa: RET504
|
||||
async with lifespan_setup(application):
|
||||
yield application
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user