Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r57338:314d3ca27ff6
Date: 2012-09-12 16:57 +0200
http://bitbucket.org/pypy/pypy/changeset/314d3ca27ff6/

Log:    we don't care about the exact exception type, as cpython is
        inconsistent

diff --git a/lib-python/3.2/test/test_exceptions.py 
b/lib-python/3.2/test/test_exceptions.py
--- a/lib-python/3.2/test/test_exceptions.py
+++ b/lib-python/3.2/test/test_exceptions.py
@@ -344,10 +344,11 @@
             self.fail("No exception raised")
 
     def testInvalidAttrs(self):
-        self.assertRaises(TypeError, setattr, Exception(), '__cause__', 1)
-        self.assertRaises(TypeError, delattr, Exception(), '__cause__')
-        self.assertRaises(TypeError, setattr, Exception(), '__context__', 1)
-        self.assertRaises(TypeError, delattr, Exception(), '__context__')
+        exc = (TypeError, AttributeError)
+        self.assertRaises(exc, setattr, Exception(), '__cause__', 1)
+        self.assertRaises(exc, delattr, Exception(), '__cause__')
+        self.assertRaises(exc, setattr, Exception(), '__context__', 1)
+        self.assertRaises(exc, delattr, Exception(), '__context__')
 
     def testNoneClearsTracebackAttr(self):
         try:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to