circuitpython/tests/extmod/uasyncio_get_event_loop.py
Damien George c4935f3049 tests/extmod: Add uasyncio tests.
All .exp files are included because they require CPython 3.8 which may not
always be available.
2020-03-26 01:25:45 +11:00

21 lines
336 B
Python

# Test get_event_loop()
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def main():
print("start")
await asyncio.sleep(0.01)
print("end")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())