[pypy-commit] cffi default: newer versions of PyPy emit a slightly different error message

antocuni noreply at buildbot.pypy.org
Thu Feb 27 11:09:04 CET 2014


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r1463:c1089d1a3c89
Date: 2014-02-27 11:08 +0100
http://bitbucket.org/cffi/cffi/changeset/c1089d1a3c89/

Log:	newer versions of PyPy emit a slightly different error message

diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -1429,8 +1429,10 @@
     p = newp(BStructPtr, [12])
     assert p.a1 == 12
     e = py.test.raises(TypeError, newp, BStructPtr, [None])
-    assert ("an integer is required" in str(e.value) or
-        "unsupported operand type for int(): 'NoneType'" in str(e.value)) #PyPy
+    msg = str(e.value)
+    assert ("an integer is required" in msg or  # CPython
+            "unsupported operand type for int(): 'NoneType'" in msg or  # old PyPys
+            "expected integer, got NoneType object" in msg) # newer PyPys
     py.test.raises(TypeError, 'p.a1 = "def"')
     if sys.version_info < (3,):
         BEnum2 = new_enum_type(unicode("foo"), (unicode('abc'),), (5,), BInt)


More information about the pypy-commit mailing list