From de078273a06fd3f7e2da3c9c9b16f2d38b8c6840 Mon Sep 17 00:00:00 2001 From: fijal Date: Mon, 12 Feb 2007 16:28:28 +0100 Subject: [PATCH] [svn r38574] Special case outcome.Failed - reuse that excinfo --HG-- branch : trunk --- py/test/rsession/executor.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/py/test/rsession/executor.py b/py/test/rsession/executor.py index cadad4f34..bb30af6ae 100644 --- a/py/test/rsession/executor.py +++ b/py/test/rsession/executor.py @@ -1,7 +1,7 @@ """ Remote executor """ -import py, os +import py, os, sys from py.__.test.rsession.outcome import Outcome, ReprOutcome from py.__.test.rsession.box import Box @@ -39,11 +39,15 @@ class RunExecutor(object): except (SystemExit, KeyboardInterrupt): raise except: - excinfo = py.code.ExceptionInfo() - if isinstance(self.item, py.test.Function): - fun = self.item.obj # hope this is stable - code = py.code.Code(fun) - excinfo.traceback = excinfo.traceback.cut( + e = sys.exc_info()[1] + if isinstance(e, Failed): + excinfo = e.excinfo + else: + excinfo = py.code.ExceptionInfo() + if isinstance(self.item, py.test.Function): + fun = self.item.obj # hope this is stable + code = py.code.Code(fun) + excinfo.traceback = excinfo.traceback.cut( path=code.path, firstlineno=code.firstlineno) outcome = Outcome(excinfo=excinfo, setupfailure=False) if self.usepdb: