From 0323c5247f81dcbe74d2a5d62d988e6d18d26a5a Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sat, 13 Nov 2010 23:33:38 +0100 Subject: [PATCH] perform represenation of short paths at test execution site --- _pytest/session.py | 3 ++- _pytest/terminal.py | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/_pytest/session.py b/_pytest/session.py index 97cd20576..25f4ae7e3 100644 --- a/_pytest/session.py +++ b/_pytest/session.py @@ -317,7 +317,8 @@ class Item(Node): return self._location except AttributeError: 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 return location diff --git a/_pytest/terminal.py b/_pytest/terminal.py index e8ddaa5d1..1fca30968 100644 --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -266,11 +266,7 @@ class TerminalReporter: def _locationline(self, collect_fspath, fspath, lineno, domain): if fspath and fspath != collect_fspath: - fspath = "%s <- %s" % ( - 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)) + fspath = "%s <- %s" % (collect_fspath, fspath) if lineno is not None: lineno += 1 if fspath and lineno and domain: