[pypy-svn] r38493 - in pypy/dist/pypy/objspace/cpy: . test

hpk at codespeak.net hpk at codespeak.net
Sun Feb 11 18:40:46 CET 2007


Author: hpk
Date: Sun Feb 11 18:40:45 2007
New Revision: 38493

Added:
   pypy/dist/pypy/objspace/cpy/test/conftest.py   (contents, props changed)
Modified:
   pypy/dist/pypy/objspace/cpy/__init__.py
Log:
skip tests for objspace/cpy if ctypes is
not importable. 



Modified: pypy/dist/pypy/objspace/cpy/__init__.py
==============================================================================
--- pypy/dist/pypy/objspace/cpy/__init__.py	(original)
+++ pypy/dist/pypy/objspace/cpy/__init__.py	Sun Feb 11 18:40:45 2007
@@ -1,2 +1,8 @@
-from objspace import CPyObjSpace
+try:
+    import ctypes as _
+except ImportError:
+    CPyObjSpace = None
+else:
+    from objspace import CPyObjSpace
+    
 Space = CPyObjSpace

Added: pypy/dist/pypy/objspace/cpy/test/conftest.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/objspace/cpy/test/conftest.py	Sun Feb 11 18:40:45 2007
@@ -0,0 +1,13 @@
+
+import py
+
+try:
+    import ctypes
+except ImportError:
+    ctypes = None
+
+class Directory(py.test.collect.Directory):
+    def run(self):
+        if ctypes is None:
+            py.test.skip("no ctypes module available")
+        return super(Directory, self).run()



More information about the Pypy-commit mailing list