Author: Armin Rigo <ar...@tunes.org>
Branch: py3.5-corowrapper
Changeset: r87191:d4946a59a6b9
Date: 2016-09-17 20:23 +0200
http://bitbucket.org/pypy/pypy/changeset/d4946a59a6b9/

Log:    Next failing test

diff --git a/pypy/interpreter/test/test_coroutine.py 
b/pypy/interpreter/test/test_coroutine.py
--- a/pypy/interpreter/test/test_coroutine.py
+++ b/pypy/interpreter/test/test_coroutine.py
@@ -66,3 +66,23 @@
         sys.set_coroutine_wrapper(None)
         assert sys.get_coroutine_wrapper() is None
         """
+
+    def test_async_with(self): """
+        seen = []
+        class X:
+            async def __aenter__(self):
+                seen.append('aenter')
+            async def __aexit__(self, *args):
+                seen.append('aexit')
+        async def f(x):
+            async with x:
+                return 42
+        c = f(X())
+        try:
+            next(c.__await__())
+        except StopIteration as e:
+            assert e.value == 42
+        else:
+            assert False, "should have raised"
+        assert seen == ['aenter', 'aexit']
+        """
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to