From ee054206b00c15988f0f71c4a947cb4d13d2af5a Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Tue, 7 Aug 2018 13:05:28 -0400 Subject: [PATCH] tests: Improve test_task_context_4 --- tests/test_context.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_context.py b/tests/test_context.py index c167abe..acc9727 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -129,11 +129,12 @@ class _ContextBaseTests: ref = weakref.ref(tracked) async def sub(): - cvar.set(tracked) + cvar.set(tracked) # NoQA self.loop.call_soon(lambda: None) async def main(): await self.loop.create_task(sub()) + await asyncio.sleep(0.01, loop=self.loop) task = self.loop.create_task(main()) self.loop.run_until_complete(task)