tests: Improve test_task_context_4

This commit is contained in:
Yury Selivanov 2018-08-07 13:05:28 -04:00
parent 8604b0361a
commit ee054206b0
1 changed files with 2 additions and 1 deletions

View File

@ -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)