[pypy-commit] pypy py3.6: Add test for CPython for atrow().throw

rmariano pypy.commits at gmail.com
Sun Jul 16 10:09:18 EDT 2017


Author: Mariano Anaya <marianoanaya at gmail.com>
Branch: py3.6
Changeset: r91905:1bf8606b71de
Date: 2017-07-16 16:08 +0200
http://bitbucket.org/pypy/pypy/changeset/1bf8606b71de/

Log:	Add test for CPython for atrow().throw

	In this case CPython raises RuntimeError, similar as if it was a
	wrong parameter to send.

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
@@ -413,3 +413,12 @@
         expected = ("can't send non-None value to a just-started coroutine", )
         assert ex.value.args == expected
         """
+
+    def test_async_yield_athrow_throw(self): """
+        async def ag():
+            yield 42
+
+        ex = raises(RuntimeError, ag().athrow(ValueError).throw, LookupError)
+        expected = ("can't send non-None value to a just-started coroutine", )
+        assert ex.value.args == expected
+    """


More information about the pypy-commit mailing list