From ead803f7fbf1c9689e6b14d6f66c12f3d9a2860a Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Thu, 13 Jun 2024 19:11:29 +0100 Subject: [PATCH] Use async fixture in testing docs (#8457) (cherry picked from commit db1b9129e5f9e3c3730d81a2ae8de059c3e38732) --- docs/testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/testing.rst b/docs/testing.rst index 027ba63a039..c2937b82282 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -111,11 +111,11 @@ app test client:: body='value: {}'.format(request.app[value]).encode('utf-8')) @pytest.fixture - def cli(loop, aiohttp_client): + async def cli(aiohttp_client): app = web.Application() app.router.add_get('/', previous) app.router.add_post('/', previous) - return loop.run_until_complete(aiohttp_client(app)) + return await aiohttp_client(app) async def test_set_value(cli): resp = await cli.post('/', data={'value': 'foo'})