From 485d6e71791b3e70fdedeb4fcdabf71360a49558 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Wed, 27 Oct 2021 21:10:18 -0400 Subject: [PATCH] Update fastapi-simple example --- examples/miniapps/fastapi-simple/tests.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/miniapps/fastapi-simple/tests.py b/examples/miniapps/fastapi-simple/tests.py index d7bd7d1f..4d80e072 100644 --- a/examples/miniapps/fastapi-simple/tests.py +++ b/examples/miniapps/fastapi-simple/tests.py @@ -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") - yield client - event_loop.run_until_complete(client.aclose()) +async def client(event_loop): + async with AsyncClient(app=app, base_url="http://test") as client: + yield client @pytest.mark.asyncio