From 91cb325850adf8c62cedaa67e786112b40aa555a Mon Sep 17 00:00:00 2001 From: Pavel Polyakov Date: Thu, 22 Sep 2022 15:36:06 +0300 Subject: [PATCH] review fixes: await task --- tests/test_scheduler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index b8add7a8..2f17d13d 100644 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -292,7 +292,7 @@ async def spawn(): for fut in futures: jobs.append(await scheduler.spawn(coro(fut))) - asyncio.create_task(spawn()) + task = asyncio.create_task(spawn()) await asyncio.sleep(0) assert len(scheduler) == 2 @@ -305,6 +305,8 @@ async def spawn(): for job in jobs: await job.wait() + await task + assert len(scheduler) == 0 assert scheduler.active_count == 0 assert scheduler.pending_count == 0