nose-devs/nose — Issue #253: pdb.set_trace() --with-doctest uses wrong stack level
Author: jpellerin
Created: 2011-12-14 16:05:27+00:00
State: closed

What steps will reproduce the problem?
1. Put a .set_trace() call in nose
2. Run a doctest using nosetests

https://python-nose.googlecode.com/svn/trunk revision 429

What is the expected output? What do you see instead?

Expected (note my defaults in the Expected / Got here include
--with-doctest --with-doctest-extension=.rst):

$ nosetests test_errorclasses.rst -s
> /home/john/src/nose/nose/proxy.py(125)addError()
-> plugins.addError(self.test, err)
(Pdb) l
120 return
121 formatted = plugins.formatError(self.test, err)
122 if formatted is not None:
123 err = formatted
124 import pdb; pdb.set_trace()
125 -> plugins.addError(self.test, err)
126 self.result.addError(self.test, err)
127 if not self.result.wasSuccessful() and self.config.stopOnError:
128 self.shouldStop = True
129
130 def addFailure(self, test, err):
(Pdb)

Got:

$ nosetests test_errorclasses.rst -s
--Return--
> /home/john/src/nose/nose/plugins/doctests.py(61)set_trace()->None
-> _orp.set_trace(self)
(Pdb) l
56 self.__debugger_used = False
57 _orp.__init__(self, out)
58
59 def set_trace(self):
60 self.__debugger_used = True
61 -> _orp.set_trace(self)
62
63 def set_continue(self):
64 # Calling set_continue unconditionally would break unit test
65 # coverage reporting, as Bdb.set_continue calls
sys.settrace(None).
66 if self.__debugger_used:
(Pdb)

Please use labels and text to provide additional information.

See attached patch

Google Code Info:
Issue #: 154
Author: j...@pobox.com
Created On: 2008-02-09T12:18:26.000Z
Closed On: 2008-03-11T00:09:18.000Z