summaryrefslogtreecommitdiff
path: root/tests/basics/async_coroutine.py
diff options
context:
space:
mode:
authorDavePutz <dwputz@gmail.com>2020-07-24 20:29:53 -0500
committerGitHub <noreply@github.com>2020-07-24 20:29:53 -0500
commit3dfed3c4aa52d06bd2eb1c28d0a1916821cc3f80 (patch)
treee585876c4e4d3500ba42dfceeb11c5bd11e7dd74 /tests/basics/async_coroutine.py
parenta14101cd137e56002ff0599d99f8234966786454 (diff)
parenta6e048686fe6999c4231582b7d9e69a7dc679257 (diff)
Merge pull request #15 from adafruit/main
update from main
Diffstat (limited to 'tests/basics/async_coroutine.py')
-rw-r--r--tests/basics/async_coroutine.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/async_coroutine.py b/tests/basics/async_coroutine.py
new file mode 100644
index 000000000..791f6df14
--- /dev/null
+++ b/tests/basics/async_coroutine.py
@@ -0,0 +1,13 @@
+async def f():
+ pass
+
+try:
+ f() # Should not crash
+except Exception as e:
+ print('failed to invoke')
+
+try:
+ next(f())
+ print('This should fail because async def returns a coroutine, and next() is not allowed')
+except Exception as e:
+ print('pass')