pdb plugin: move entering pdb into a toplevel function

this prepares pdb at collect time
This commit is contained in:
Ronny Pfannschmidt 2013-04-18 11:18:24 +02:00
parent 55c349a9eb
commit cf7cae0780
1 changed files with 19 additions and 13 deletions

View File

@ -61,6 +61,12 @@ class PdbInvoke:
return rep return rep
if hasattr(rep, "wasxfail"): if hasattr(rep, "wasxfail"):
return rep return rep
return _enter_pdb(item, call.excinfo, rep)
def _enter_pdb(item, excinfo, rep):
# we assume that the above execute() suspended capturing # we assume that the above execute() suspended capturing
# XXX we re-use the TerminalReporter's terminalwriter # XXX we re-use the TerminalReporter's terminalwriter
# because this seems to avoid some encoding related troubles # because this seems to avoid some encoding related troubles
@ -71,7 +77,7 @@ class PdbInvoke:
rep.toterminal(tw) rep.toterminal(tw)
tw.sep(">", "entering PDB") tw.sep(">", "entering PDB")
tb = _postmortem_traceback(call.excinfo) tb = _postmortem_traceback(excinfo)
post_mortem(tb) post_mortem(tb)
rep._pdbshown = True rep._pdbshown = True
return rep return rep