From 64e5ab1867ea9ef87901bb2a1a6142566bffc90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 21 Jan 2023 16:41:25 -0800 Subject: [PATCH] make tests compatible with Python 3.11 --- test_webtest_aiohttp.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/test_webtest_aiohttp.py b/test_webtest_aiohttp.py index 6ba65fa..4b21523 100644 --- a/test_webtest_aiohttp.py +++ b/test_webtest_aiohttp.py @@ -10,26 +10,21 @@ @pytest.fixture() def app(): - @asyncio.coroutine - def handler(request): + async def handler(request): return json_response({'message': 'Hello world'}) - @asyncio.coroutine - def echo_post(request): - form_body = yield from request.post() + async def echo_post(request): + form_body = await request.post() return json_response(dict(form_body)) - @asyncio.coroutine - def echo_json(request): - json_body = yield from request.json() + async def echo_json(request): + json_body = await request.json() return json_response(json_body) - @asyncio.coroutine - def echo_headers(request): + async def echo_headers(request): return json_response(dict(request.headers)) - @asyncio.coroutine - def echo_params(request): + async def echo_params(request): return json_response(dict(request.query)) app_ = web.Application()