Update fastapi-simple example

This commit is contained in:
Roman Mogylatov 2021-10-27 21:10:18 -04:00
parent 14744e4b70
commit 485d6e7179

View File

@ -7,10 +7,9 @@ from fastapi_di_example import app, container, Service
@pytest.fixture
def client(event_loop):
client = AsyncClient(app=app, base_url="http://test")
async def client(event_loop):
async with AsyncClient(app=app, base_url="http://test") as client:
yield client
event_loop.run_until_complete(client.aclose())
@pytest.mark.asyncio