def execute(self, capture=True): |
try: |
-> self.run(capture) |
outcome = Outcome() |
except Skipped, e: |
outcome = Outcome(skipped=str(e)) |
except (SystemExit, KeyboardInterrupt): |
raise |
except: |
e = sys.exc_info()[1] |
if isinstance(e, Failed) and e.excinfo: |
excinfo = e.excinfo |
else: |
excinfo = py.code.ExceptionInfo() |
if isinstance(self.item, py.test.collect.Function): |
fun = self.item.obj |
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: |
if self.reporter is not None: |
self.reporter(repevent.ImmediateFailure(self.item, |
ReprOutcome(outcome.make_repr |
(self.config.option.tbstyle)))) |
import pdb |
pdb.post_mortem(excinfo._excinfo[2]) |
|
|
raise SystemExit() |
outcome.stdout, outcome.stderr = self.item._getouterr() |
return outcome |