Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r52464:639f68fb00e9
Date: 2012-02-14 14:11 +0100
http://bitbucket.org/pypy/pypy/changeset/639f68fb00e9/

Log:    two more tests from cpython's test suite. The first passes, the
        second is failing

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
@@ -171,6 +171,38 @@
                 nested_reraise()
         """)
 
+    def test_with_reraise_1(self):
+        class Context:
+            def __enter__(self):
+                return self
+            def __exit__(self, exc_type, exc_value, exc_tb):
+                return True
+
+        def fn():
+            try:
+                raise ValueError("foo")
+            except:
+                with Context():
+                    pass
+                raise
+        raises(ValueError, "fn()")
+
+
+    def test_with_reraise_2(self):
+        class Context:
+            def __enter__(self):
+                return self
+            def __exit__(self, exc_type, exc_value, exc_tb):
+                return True
+
+        def fn():
+            try:
+                raise ValueError("foo")
+            except:
+                with Context():
+                    raise KeyError("caught")
+                raise
+        raises(ValueError, "fn()")
 
     def test_userclass(self):
         # new-style classes can't be raised unless they inherit from
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to