diff options
Diffstat (limited to 'tests/basics/async_with.py')
-rw-r--r-- | tests/basics/async_with.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/basics/async_with.py b/tests/basics/async_with.py index 742f9ba99..9eccfd816 100644 --- a/tests/basics/async_with.py +++ b/tests/basics/async_with.py @@ -4,7 +4,7 @@ class AContext: async def __aenter__(self): print('enter') async def __aexit__(self, exc_type, exc, tb): - print('exit') + print('exit', exc_type, exc) async def f(): async with AContext(): @@ -15,3 +15,13 @@ try: o.send(None) except StopIteration: print('finished') + +async def g(): + async with AContext(): + raise ValueError('error') + +o = g() +try: + o.send(None) +except ValueError: + print('ValueError') |