[pypy-svn] r74226 - in pypy/branch/py12: lib-python pypy

hpk at codespeak.net hpk at codespeak.net
Thu Apr 29 16:55:58 CEST 2010


Author: hpk
Date: Thu Apr 29 16:55:57 2010
New Revision: 74226

Modified:
   pypy/branch/py12/lib-python/conftest.py
   pypy/branch/py12/pypy/conftest.py
Log:
avoid deprecation warnings by using new pytest collect related hooks


Modified: pypy/branch/py12/lib-python/conftest.py
==============================================================================
--- pypy/branch/py12/lib-python/conftest.py	(original)
+++ pypy/branch/py12/lib-python/conftest.py	Thu Apr 29 16:55:57 2010
@@ -531,7 +531,8 @@
                 l.append(RunFileExternal(name, parent=self, regrtest=regrtest))
         return l 
 
-Directory = RegrDirectory
+def pytest_collect_directory(parent, path):
+    return RegrDirectory(path, parent)
 
 class RunFileExternal(py.test.collect.File):
     def __init__(self, name, parent, regrtest): 

Modified: pypy/branch/py12/pypy/conftest.py
==============================================================================
--- pypy/branch/py12/pypy/conftest.py	(original)
+++ pypy/branch/py12/pypy/conftest.py	Thu Apr 29 16:55:57 2010
@@ -196,7 +196,10 @@
         if not hasattr(__builtin__, helper):
             setattr(__builtin__, helper, getattr(py.test, helper))
 
-class Module(py.test.collect.Module): 
+def pytest_pycollect_makemodule(path, parent):
+    return PyPyModule(path, parent)
+
+class PyPyModule(py.test.collect.Module): 
     """ we take care of collecting classes both at app level 
         and at interp-level (because we need to stick a space 
         at the class) ourselves. 
@@ -204,7 +207,7 @@
     def __init__(self, *args, **kwargs):
         if hasattr(sys, 'pypy_objspaceclass'):
             option.conf_iocapture = "sys" # pypy cannot do FD-based
-        super(Module, self).__init__(*args, **kwargs)
+        super(PyPyModule, self).__init__(*args, **kwargs)
 
     def accept_regular_test(self):
         if option.runappdirect:
@@ -235,7 +238,7 @@
     def setup(self): 
         # stick py.test raise in module globals -- carefully
         ensure_pytest_builtin_helpers() 
-        super(Module, self).setup() 
+        super(PyPyModule, self).setup() 
         #    if hasattr(mod, 'objspacename'): 
         #        mod.space = getttestobjspace(mod.objspacename)
 
@@ -512,9 +515,5 @@
             py.test.skip("pexpect not found")
 
 
-class Directory(py.test.collect.Directory):
-
-    def recfilter(self, path):
-        # disable recursion in symlinked subdirectories
-        return (py.test.collect.Directory.recfilter(self, path)
-                and path.check(link=0))
+def pytest_ignore_collect_path(path):
+    return path.check(link=1)



More information about the Pypy-commit mailing list