[py-svn] r36697 - in py/dist/py/test: . testing
arigo at codespeak.net
arigo at codespeak.net
Sat Jan 13 19:37:59 CET 2007
Author: arigo
Date: Sat Jan 13 19:37:56 2007
New Revision: 36697
Modified:
py/dist/py/test/collect.py
py/dist/py/test/testing/test_config.py
Log:
A fix for this test. This is an old diff I've been using for a while without problem.
It makes things more lazy in some way but I don't remember the details :-/
Modified: py/dist/py/test/collect.py
==============================================================================
--- py/dist/py/test/collect.py (original)
+++ py/dist/py/test/collect.py Sat Jan 13 19:37:56 2007
@@ -288,12 +288,21 @@
return path.check(dotfile=0) and \
path.basename not in ('CVS', '_darcs', '{arch}')
+ def pathfilter(self, path):
+ if path.check(file=1) and self.filefilter(path):
+ return True
+ elif path.check(dir=1) and self.recfilter(path):
+ return True
+ else:
+ return False
+
def buildname2items(self):
d = {}
for p in self.fspath.listdir():
- x = self.makeitem(p.basename, self.filefilter, self.recfilter)
- if x is not None:
- d[p.basename] = x
+ if self.pathfilter(p):
+ x = self.join(p.basename)
+ if x is not None:
+ d[p.basename] = x
return d
def makeitem(self, basename, filefilter=None, recfilter=None):
@@ -307,11 +316,15 @@
Directory = py.test.Config.getvalue('Directory', p)
return Directory(p, parent=self)
- def join(self, name):
- x = super(Directory, self).join(name)
- if x is None:
- x = self.makeitem(name)
- return x
+ def join(self, name):
+ # cache the results to avoid duplicate instances
+ if not hasattr(self, '_joincache'):
+ self._joincache = {}
+ try:
+ x = self._joincache[name]
+ except KeyError:
+ x = self._joincache[name] = self.makeitem(name)
+ return x
class PyCollectorMixin(object):
def funcnamefilter(self, name):
Modified: py/dist/py/test/testing/test_config.py
==============================================================================
--- py/dist/py/test/testing/test_config.py (original)
+++ py/dist/py/test/testing/test_config.py Sat Jan 13 19:37:56 2007
@@ -76,7 +76,6 @@
#
def test_siblingconftest_fails_maybe():
- py.test.skip("in-progress")
from py.__.test import config
cfg = config.Config()
o = py.test.ensuretemp('siblingconftest')
More information about the pytest-commit
mailing list