perform represenation of short paths at test execution site

This commit is contained in:
holger krekel 2010-11-13 23:33:38 +01:00
parent 82ba645a2e
commit 0323c5247f
2 changed files with 3 additions and 6 deletions

View File

@ -317,7 +317,8 @@ class Item(Node):
return self._location return self._location
except AttributeError: except AttributeError:
location = self.reportinfo() location = self.reportinfo()
location = (str(location[0]), location[1], str(location[2])) fspath = self.session.fspath.bestrelpath(location[0])
location = (fspath, location[1], str(location[2]))
self._location = location self._location = location
return location return location

View File

@ -266,11 +266,7 @@ class TerminalReporter:
def _locationline(self, collect_fspath, fspath, lineno, domain): def _locationline(self, collect_fspath, fspath, lineno, domain):
if fspath and fspath != collect_fspath: if fspath and fspath != collect_fspath:
fspath = "%s <- %s" % ( fspath = "%s <- %s" % (collect_fspath, fspath)
self.curdir.bestrelpath(py.path.local(collect_fspath)),
self.curdir.bestrelpath(py.path.local(fspath)))
elif fspath:
fspath = self.curdir.bestrelpath(py.path.local(fspath))
if lineno is not None: if lineno is not None:
lineno += 1 lineno += 1
if fspath and lineno and domain: if fspath and lineno and domain: