[pypy-commit] pypy reflex-support: disable all tests if run with -A and genreflex not available

wlav noreply at buildbot.pypy.org
Fri Apr 25 04:04:31 CEST 2014


Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r70959:534ad693bc66
Date: 2014-04-24 19:02 -0700
http://bitbucket.org/pypy/pypy/changeset/534ad693bc66/

Log:	disable all tests if run with -A and genreflex not available

diff --git a/pypy/module/cppyy/test/conftest.py b/pypy/module/cppyy/test/conftest.py
--- a/pypy/module/cppyy/test/conftest.py
+++ b/pypy/module/cppyy/test/conftest.py
@@ -15,6 +15,10 @@
                 not re.search("test0[1-36]", item.location[2]):
                 py.test.skip("genreflex is not installed")
 
+def pytest_ignore_collect(path, config):
+    if py.path.local.sysfind('genreflex') is None and config.option.runappdirect:
+        return True          # "can't run dummy tests in -A"
+
 def pytest_configure(config):
     if py.path.local.sysfind('genreflex') is None:
         import pypy.module.cppyy.capi.loadable_capi as lcapi
@@ -22,6 +26,9 @@
             import ctypes
             ctypes.CDLL(lcapi.reflection_library)
         except Exception, e:
+            if config.option.runappdirect:
+                return       # "can't run dummy tests in -A"
+
             # build dummy backend (which has reflex info and calls hard-wired)
             import os
             from rpython.translator.tool.cbuild import ExternalCompilationInfo


More information about the pypy-commit mailing list