This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/python/yap_kernel/yap_kernel/tests/_asyncio.py
Vitor Santos Costa 9c862c21bc jupyter
2018-01-05 16:57:38 +00:00

18 lines
363 B
Python

"""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())