[pypy-svn] pypy commit 5dd96b26842b: move the conftest again, and try to use another way to skip the tests on cpython :-/

Bitbucket commits-noreply at bitbucket.org
Wed Dec 15 11:40:58 CET 2010


# HG changeset patch -- Bitbucket.org
# Project pypy
# URL http://bitbucket.org/pypy/pypy/overview
# User Antonio Cuni <anto.cuni at gmail.com>
# Date 1292409594 -3600
# Node ID 5dd96b26842be3e90ae4fc457a1c7d36a4288548
# Parent  84e43c98862c993e13c50de1774261b14dffddad
move the conftest again, and try to use another way to skip the tests on cpython :-/

--- /dev/null
+++ b/pypy/module/test_lib_pypy/ctypes_tests/conftest.py
@@ -0,0 +1,25 @@
+import py
+import sys
+
+def pytest_ignore_collect(path):
+    if '__pypy__' not in sys.builtin_module_names:
+        return True
+
+def compile_so_file():
+    from pypy.translator.platform import platform
+    from pypy.translator.tool.cbuild import ExternalCompilationInfo
+    udir = py.test.ensuretemp('_ctypes_test')
+    cfile = py.path.local(__file__).dirpath().join("_ctypes_test.c")
+
+    if sys.platform == 'win32':
+        libraries = ['oleaut32']
+    else:
+        libraries = []
+    eci = ExternalCompilationInfo(libraries=libraries)
+
+    return platform.compile([cfile], eci, str(udir.join('_ctypes_test')),
+                            standalone=False)
+
+def pytest_configure(config):
+    global sofile
+    sofile = compile_so_file()

--- a/pypy/module/test_lib_pypy/conftest.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import py
-import sys
-
-def pytest_collect_directory():
-    if '__pypy__' not in sys.builtin_module_names:
-        py.test.skip("these tests are meant to be run on top of pypy-c")
-
-def compile_so_file():
-    from pypy.translator.platform import platform
-    from pypy.translator.tool.cbuild import ExternalCompilationInfo
-    udir = py.test.ensuretemp('_ctypes_test')
-    cfile = py.path.local(__file__).dirpath().join("ctypes_tests", "_ctypes_test.c")
-
-    if sys.platform == 'win32':
-        libraries = ['oleaut32']
-    else:
-        libraries = []
-    eci = ExternalCompilationInfo(libraries=libraries)
-
-    return platform.compile([cfile], eci, str(udir.join('_ctypes_test')),
-                            standalone=False)
-
-def pytest_configure(config):
-    global sofile
-    sofile = compile_so_file()



More information about the Pypy-commit mailing list