diff options
Diffstat (limited to 'tests/basics/async_with.py')
-rw-r--r-- | tests/basics/async_with.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/async_with.py b/tests/basics/async_with.py index 5af0c5d95..f7774055c 100644 --- a/tests/basics/async_with.py +++ b/tests/basics/async_with.py @@ -27,3 +27,13 @@ try: o.send(None) except ValueError: print('ValueError') + +# test raising BaseException to make sure it is handled by the async-with +async def h(): + async with AContext(): + raise BaseException +o = h() +try: + o.send(None) +except BaseException: + print('BaseException') |