summaryrefslogtreecommitdiff
path: root/tests/basics/async_def.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/async_def.py')
-rw-r--r--tests/basics/async_def.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/basics/async_def.py b/tests/basics/async_def.py
new file mode 100644
index 000000000..e345703d7
--- /dev/null
+++ b/tests/basics/async_def.py
@@ -0,0 +1,16 @@
+# test async def
+
+def dec(f):
+ print('decorator')
+ return f
+
+# test definition with a decorator
+@dec
+async def foo():
+ print('foo')
+
+coro = foo()
+try:
+ coro.send(None)
+except StopIteration:
+ print('StopIteration')