summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/async_coroutine.py13
-rw-r--r--tests/basics/async_coroutine.py.exp1
2 files changed, 14 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')
diff --git a/tests/basics/async_coroutine.py.exp b/tests/basics/async_coroutine.py.exp
new file mode 100644
index 000000000..2ae28399f
--- /dev/null
+++ b/tests/basics/async_coroutine.py.exp
@@ -0,0 +1 @@
+pass