diff options
author | Antonio Cuni <anto.cuni@gmail.com> | 2014-02-27 11:08:18 +0100 |
---|---|---|
committer | Antonio Cuni <anto.cuni@gmail.com> | 2014-02-27 11:08:18 +0100 |
commit | ee77470369a90a1ab8fb2898e9504ca9ea54fb88 (patch) | |
tree | a031d4a1f1309774efc3d14d0f1f72cb433543e6 /c | |
parent | ffe751a21307d6be3eaba9ed7eb2370d7a77c32c (diff) | |
download | cffi-ee77470369a90a1ab8fb2898e9504ca9ea54fb88.tar.gz |
newer versions of PyPy emit a slightly different error message
Diffstat (limited to 'c')
-rw-r--r-- | c/test_c.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/c/test_c.py b/c/test_c.py index 09d0a13..331107d 100644 --- a/c/test_c.py +++ b/c/test_c.py @@ -1429,8 +1429,10 @@ def test_enum_in_struct(): 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) |