summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/async_def.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-11 12:30:32 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-11 12:30:32 +1100
commit5e22afce41de8c87071d8fc149a6ba3cd8762819 (patch)
treecc8960bfe8bb7949ad5dd6a099ae3e390cb58359 /tests/basics/async_def.py
parente49153fb98ade48395b80271093bd763e771b3da (diff)
downloadmicropython-5e22afce41de8c87071d8fc149a6ba3cd8762819.tar.gz
micropython-5e22afce41de8c87071d8fc149a6ba3cd8762819.zip
tests: Improve test coverage of py/compile.c.
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 0000000000..e345703d74
--- /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')