[svn r38574] Special case outcome.Failed - reuse that excinfo

--HG--
branch : trunk
This commit is contained in:
fijal 2007-02-12 16:28:28 +01:00
parent 6210030d27
commit de078273a0
1 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,7 @@
""" Remote executor """ Remote executor
""" """
import py, os import py, os, sys
from py.__.test.rsession.outcome import Outcome, ReprOutcome from py.__.test.rsession.outcome import Outcome, ReprOutcome
from py.__.test.rsession.box import Box from py.__.test.rsession.box import Box
@ -39,11 +39,15 @@ class RunExecutor(object):
except (SystemExit, KeyboardInterrupt): except (SystemExit, KeyboardInterrupt):
raise raise
except: except:
excinfo = py.code.ExceptionInfo() e = sys.exc_info()[1]
if isinstance(self.item, py.test.Function): if isinstance(e, Failed):
fun = self.item.obj # hope this is stable excinfo = e.excinfo
code = py.code.Code(fun) else:
excinfo.traceback = excinfo.traceback.cut( 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) path=code.path, firstlineno=code.firstlineno)
outcome = Outcome(excinfo=excinfo, setupfailure=False) outcome = Outcome(excinfo=excinfo, setupfailure=False)
if self.usepdb: if self.usepdb: