[py-svn] r38574 - py/trunk/py/test/rsession
fijal at codespeak.net
fijal at codespeak.net
Mon Feb 12 16:28:37 CET 2007
Author: fijal
Date: Mon Feb 12 16:28:28 2007
New Revision: 38574
Modified:
py/trunk/py/test/rsession/executor.py
Log:
Special case outcome.Failed - reuse that excinfo
Modified: py/trunk/py/test/rsession/executor.py
==============================================================================
--- py/trunk/py/test/rsession/executor.py (original)
+++ py/trunk/py/test/rsession/executor.py Mon Feb 12 16:28:28 2007
@@ -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 @@
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:
More information about the pytest-commit
mailing list