[pypy-commit] cffi default: Add compatibility with pytest 4.0 without breaking older pytests

arigo pypy.commits at gmail.com
Wed Nov 21 00:49:57 EST 2018


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r3171:828c24a88bf6
Date: 2018-11-21 07:49 +0200
http://bitbucket.org/cffi/cffi/changeset/828c24a88bf6/

Log:	Add compatibility with pytest 4.0 without breaking older pytests

diff --git a/testing/cffi1/test_parse_c_type.py b/testing/cffi1/test_parse_c_type.py
--- a/testing/cffi1/test_parse_c_type.py
+++ b/testing/cffi1/test_parse_c_type.py
@@ -3,7 +3,12 @@
 from cffi import cffi_opcode
 
 if '__pypy__' in sys.builtin_module_names:
-    py.test.skip("not available on pypy")
+    try:
+        # pytest >= 4.0
+        py.test.skip("not available on pypy", allow_module_level=True)
+    except TypeError:
+        # older pytest
+        py.test.skip("not available on pypy")
 
 cffi_dir = os.path.dirname(cffi_opcode.__file__)
 


More information about the pypy-commit mailing list