Author: Ronan Lamy <[email protected]>
Branch: apptest-file
Changeset: r95320:92562abdaf9f
Date: 2018-11-15 18:11 +0000
http://bitbucket.org/pypy/pypy/changeset/92562abdaf9f/
Log: Skip _cffi_backend C tests when versions don't match, instead of
reporting umpteen failures
diff --git a/pypy/module/_cffi_backend/test/test_c.py
b/pypy/module/_cffi_backend/test/test_c.py
--- a/pypy/module/_cffi_backend/test/test_c.py
+++ b/pypy/module/_cffi_backend/test/test_c.py
@@ -16,8 +16,6 @@
5. make the test pass in pypy ('py.test test_c.py')
"""
import py, sys, ctypes
-if sys.version_info < (2, 6):
- py.test.skip("requires the b'' literal syntax")
from rpython.tool.udir import udir
from pypy.interpreter import gateway
@@ -27,6 +25,8 @@
from rpython.translator.platform import host
from rpython.translator.tool.cbuild import ExternalCompilationInfo
+from .. import VERSION as TEST_VERSION
+
class AppTestC(object):
"""Populated below, hack hack hack."""
@@ -34,6 +34,15 @@
spaceconfig = dict(usemodules=('_cffi_backend', 'cStringIO', 'array'))
def setup_class(cls):
+ if cls.runappdirect:
+ _cffi_backend = py.test.importorskip('_cffi_backend')
+ if _cffi_backend.__version__ != TEST_VERSION:
+ py.test.skip(
+ "These tests are for cffi version %s, this Python "
+ "has version %s installed" %
+ (TEST_VERSION, _cffi_backend.__version__))
+
+
testfuncs_w = []
keepalive_funcs = []
UniqueCache.for_testing = True
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit