[pypy-svn] r63716 - pypy/trunk/pypy

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Apr 6 14:44:36 CEST 2009


Author: cfbolz
Date: Mon Apr  6 14:44:36 2009
New Revision: 63716

Modified:
   pypy/trunk/pypy/conftest.py
Log:
Solve the problem more generally. There are already checks in
config/pypyoption.py that find out whether a specific module can be enabled on
the machine or not. Use this mechanism in gettestobjspace to skip the test if a
module is requested that is not importable.


Modified: pypy/trunk/pypy/conftest.py
==============================================================================
--- pypy/trunk/pypy/conftest.py	(original)
+++ pypy/trunk/pypy/conftest.py	Mon Apr  6 14:44:36 2009
@@ -4,6 +4,7 @@
 from pypy.interpreter.error import OperationError
 from pypy.tool.pytest import appsupport
 from pypy.tool.option import make_config, make_objspace
+from pypy.config.config import ConflictConfigError
 from inspect import isclass, getmro
 from pypy.tool.udir import udir
 from pypy.tool.autopath import pypydir
@@ -52,7 +53,12 @@
 def gettestobjspace(name=None, **kwds):
     """ helper for instantiating and caching space's for testing. 
     """ 
-    config = make_config(option, objspace=name, **kwds)
+    try:
+        config = make_config(option, objspace=name, **kwds)
+    except ConflictConfigError, e:
+        # this exception is typically only raised if a module is not available.
+        # in this case the test should be skipped
+        py.test.skip(str(e))
     key = config.getkey()
     try:
         return _SPACECACHE[key]



More information about the Pypy-commit mailing list