lv_micropython/tests/extmod/asyncio_get_event_loop.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
330 B
Python
Raw Normal View History

# Test get_event_loop()
# Note: CPython deprecated get_event_loop() so this test needs a .exp
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())