You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/ipykernel/tests/_asyncio_utils.py

18 lines
363 B

"""test utilities that use async/await syntax
a separate file to avoid syntax errors on Python 2
"""
import asyncio
def async_func():
"""Simple async function to schedule a task on the current eventloop"""
loop = asyncio.get_event_loop()
assert loop.is_running()
async def task():
await asyncio.sleep(1)
loop.create_task(task())