Files
Elizaveta Shashkova 53dfabc216 PY-31598 False positive: coroutine is not awaited for background tasks
In some cases Tasks can be created to run in background without awaiting. Disable inspection for functions, which return Task and for builtin functions which schedule function run in a loop without await.
2018-12-25 19:30:25 +03:00

15 lines
220 B
Python

import asyncio
async def nested():
print("42")
async def main():
# Schedule nested() to run soon concurrently with "main()".
asyncio.create_task(nested())
await asyncio.sleep(3)
asyncio.run(main())