[py-svn] r9835 - py/branch/py-collect/test
hpk at codespeak.net
hpk at codespeak.net
Wed Mar 16 16:52:07 CET 2005
Author: hpk
Date: Wed Mar 16 16:52:07 2005
New Revision: 9835
Modified:
py/branch/py-collect/test/drive.py
py/branch/py-collect/test/run.py
Log:
incorporated Jan Balster's fixes to session/remote modes
Modified: py/branch/py-collect/test/drive.py
==============================================================================
--- py/branch/py-collect/test/drive.py (original)
+++ py/branch/py-collect/test/drive.py Wed Mar 16 16:52:07 2005
@@ -54,6 +54,11 @@
except Exit, ex:
pass
+ # return [(fspath as string, [names as string])]
+ return [(str(item.listchain()[0].fspath), item.listnames())
+ for item, res in self.getresults(py.test.Item.Failed)]
+
+
def runone(self, colitem):
if self.shouldclose():
raise SystemExit, "received external close signal"
Modified: py/branch/py-collect/test/run.py
==============================================================================
--- py/branch/py-collect/test/run.py (original)
+++ py/branch/py-collect/test/run.py Wed Mar 16 16:52:07 2005
@@ -94,7 +94,7 @@
args, failures = channel.receive()
driver, paths = py.test.config.init(args, ignoreremote=True)
if failures:
- cols = [FailureCollector(failures)]
+ cols = FailureCollector(failures)
else:
cols = list(getcollectors(paths))
driver.shouldclose = channel.isclosed
@@ -105,8 +105,15 @@
def __init__(self, failures):
self.failures = failures
def __iter__(self):
- for root, names in self.failures:
- current = root
+ for rootpath, names in self.failures:
+ root = py.path.local(rootpath)
+ if root.check(dir=1):
+ current = py.test.Directory(root).Directory(root)
+ elif root.check(file=1):
+ current = py.test.Module(root).Module(root)
+ # root is fspath of names[0] -> pop names[0]
+ # slicing works with empty lists
+ names = names[1:]
while names:
name = names.pop(0)
try:
@@ -143,8 +150,8 @@
break
print "#" * 60
print "# session mode: %d failures remaining" % len(failures)
- for x in failures:
- name = ":".join(x) # XXX
+ for root, names in failures:
+ name = ":".join(names) # XXX
print "Failure at: %r" % (name,)
print "# watching py files below %s" % rootdir
- print "# ", "^" * len(rootdir)
+ print "# ", "^" * len(str(rootdir))
More information about the pytest-commit
mailing list