Author: Armin Rigo <[email protected]>
Branch:
Changeset: r3164:e2e324a2f13e
Date: 2018-09-19 17:05 +0200
http://bitbucket.org/cffi/cffi/changeset/e2e324a2f13e/
Log: Issue #384
Un-ignore the warnings when testing for them, in case someone runs
py.test with the PYTHONWARNINGS environment variable set
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3968,6 +3968,7 @@
z3 = cast(BVoidP, 0)
z4 = cast(BUCharP, 0)
with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
newp(new_pointer_type(BIntP), z1) # warn
assert len(w) == 1
newp(new_pointer_type(BVoidP), z1) # fine
diff --git a/testing/cffi0/backend_tests.py b/testing/cffi0/backend_tests.py
--- a/testing/cffi0/backend_tests.py
+++ b/testing/cffi0/backend_tests.py
@@ -1386,6 +1386,7 @@
ffi = FFI(backend=self.Backend())
ffi.cdef("enum foo;")
with warnings.catch_warnings(record=True) as log:
+ warnings.simplefilter("always")
n = ffi.cast("enum foo", -1)
assert int(n) == 0xffffffff
assert str(log[0].message) == (
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit