[pypy-commit] pypy default: add test that passes on pypy2 but not pypy3

arigo pypy.commits at gmail.com
Sun Jul 1 16:51:16 EDT 2018


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r94793:55061f499bd5
Date: 2018-07-01 22:39 +0200
http://bitbucket.org/pypy/pypy/changeset/55061f499bd5/

Log:	add test that passes on pypy2 but not pypy3

diff --git a/pypy/interpreter/test/test_raise.py b/pypy/interpreter/test/test_raise.py
--- a/pypy/interpreter/test/test_raise.py
+++ b/pypy/interpreter/test/test_raise.py
@@ -280,3 +280,15 @@
             def __new__(cls, *args):
                 return object()
         raises(TypeError, "raise MyException")
+
+    def test_with_exit_True(self):
+        class X:
+            def __enter__(self):
+                pass
+            def __exit__(self, *args):
+                return True
+        def g():
+            with X():
+                return 42
+            assert False, "unreachable"
+        assert g() == 42


More information about the pypy-commit mailing list