diff options
Diffstat (limited to 'tests/basics/async_coroutine.py')
| -rw-r--r-- | tests/basics/async_coroutine.py | 13 |
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') |
