diff --git a/tests/test_run_app.py b/tests/test_run_app.py index 622fa560e24..dab36942e49 100644 --- a/tests/test_run_app.py +++ b/tests/test_run_app.py @@ -1284,6 +1284,7 @@ async def run_test(app: web.Application) -> AsyncIterator[None]: nonlocal t t = asyncio.create_task(test()) yield + await asyncio.sleep(0) # In case test() hasn't resumed yet. t.cancel() with contextlib.suppress(asyncio.CancelledError): await t