From 73446e98be4b4a1e721d1b00d0cf97e0ed1c60c3 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 16 Apr 2013 10:18:08 +0200 Subject: [PATCH] turn the postmortem traceback selection to a function --- _pytest/pdb.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/_pytest/pdb.py b/_pytest/pdb.py index c9471401a..1bf6086f5 100644 --- a/_pytest/pdb.py +++ b/_pytest/pdb.py @@ -71,19 +71,20 @@ class PdbInvoke: rep.toterminal(tw) tw.sep(">", "entering PDB") - tb = self._postmortem_traceback(call.excinfo) + tb = _postmortem_traceback(call.excinfo) post_mortem(tb) rep._pdbshown = True return rep - @staticmethod - def _postmortem_traceback(excinfo): - # A doctest.UnexpectedException is not useful for post_mortem. - # Use the underlying exception instead: - if isinstance(excinfo.value, py.std.doctest.UnexpectedException): - return excinfo.value.exc_info[2] - else: - return excinfo._excinfo[2] + +def _postmortem_traceback(excinfo): + # A doctest.UnexpectedException is not useful for post_mortem. + # Use the underlying exception instead: + if isinstance(excinfo.value, py.std.doctest.UnexpectedException): + return excinfo.value.exc_info[2] + else: + return excinfo._excinfo[2] + def post_mortem(t): pdb = py.std.pdb