Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion nose/plugins/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import pdb
from nose.plugins.base import Plugin
import sys
import traceback

class Pdb(Plugin):
"""
Expand Down Expand Up @@ -52,10 +54,14 @@ def addFailure(self, test, err):
self.debug(err)

def debug(self, err):
import sys # FIXME why is this import here?
ec, ev, tb = err
stdout = sys.stdout
sys.stdout = sys.__stdout__
# print out the exception and traceback (pdb doesn't do this
# automatically)
print >> sys.stderr
traceback.print_exception(ec,ev,tb)
print >> sys.stderr
try:
pdb.post_mortem(tb)
finally:
Expand Down