[pypy-svn] r75109 - pypy/branch/lib-python/lib-python
hpk at codespeak.net
hpk at codespeak.net
Fri Jun 4 16:43:08 CEST 2010
Author: hpk
Date: Fri Jun 4 16:43:06 2010
New Revision: 75109
Modified:
pypy/branch/lib-python/lib-python/conftest.py
Log:
new try to sanitize lib-python testing
Modified: pypy/branch/lib-python/lib-python/conftest.py
==============================================================================
--- pypy/branch/lib-python/lib-python/conftest.py (original)
+++ pypy/branch/lib-python/lib-python/conftest.py Fri Jun 4 16:43:06 2010
@@ -520,11 +520,14 @@
return cache.get(name, None)
def collect(self):
+ we_are_in_modified = self.fspath == modregrtestdir
l = []
- for x in testmap:
+ for x in self.fspath.listdir():
name = x.basename
regrtest = self.get(name)
- if regrtest is not None:
+ if regrtest is not None:
+ if bool(we_are_in_modified) ^ regrtest.ismodified():
+ continue
#if option.extracttests:
# l.append(InterceptedRunModule(name, self, regrtest))
#else:
@@ -532,7 +535,14 @@
return l
def pytest_collect_directory(parent, path):
- return RegrDirectory(path, parent)
+ # use RegrDirectory collector for both modified and unmodified tests
+ if path in (modregrtestdir, regrtestdir):
+ return RegrDirectory(path, parent)
+
+def pytest_ignore_collect(path):
+ # ignore all files - only RegrDirectory generates tests in lib-python
+ if path.check(file=1):
+ return True
class RunFileExternal(py.test.collect.File):
def __init__(self, name, parent, regrtest):
More information about the Pypy-commit
mailing list