From c33df193bfbc09dc5c3b62db6507ad1a79e92ea6 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 13 Apr 2016 15:27:06 +0100 Subject: tests: Add 6 tests for async await/for/with. --- tests/basics/async_with.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/basics/async_with.py (limited to 'tests/basics/async_with.py') diff --git a/tests/basics/async_with.py b/tests/basics/async_with.py new file mode 100644 index 0000000000..742f9ba993 --- /dev/null +++ b/tests/basics/async_with.py @@ -0,0 +1,17 @@ +# test simple async with execution + +class AContext: + async def __aenter__(self): + print('enter') + async def __aexit__(self, exc_type, exc, tb): + print('exit') + +async def f(): + async with AContext(): + print('body') + +o = f() +try: + o.send(None) +except StopIteration: + print('finished') -- cgit v1.2.3