Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2799:3cf075e86070
Date: 2016-10-25 12:04 +0200
http://bitbucket.org/cffi/cffi/changeset/3cf075e86070/
Log: Fix test
diff --git a/testing/cffi1/test_recompiler.py b/testing/cffi1/test_recompiler.py
--- a/testing/cffi1/test_recompiler.py
+++ b/testing/cffi1/test_recompiler.py
@@ -399,11 +399,14 @@
pass # ok, fail during compilation already (e.g. C++)
else:
assert ffi.sizeof("struct foo_s") == 24 # found by the actual C code
- p = ffi.new("struct foo_s *")
- # lazily build the fields and boom:
- e = py.test.raises(ffi.error, "p.a")
- assert str(e.value).startswith("struct foo_s: wrong size for field 'a'
"
- "(cdef says 20, but C compiler says
24)")
+ try:
+ # lazily build the fields and boom:
+ p = ffi.new("struct foo_s *")
+ p.a
+ assert False, "should have raised"
+ except ffi.error as e:
+ assert str(e).startswith("struct foo_s: wrong size for field 'a' "
+ "(cdef says 20, but C compiler says 24)")
def test_open_array_in_struct():
ffi = FFI()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit