Breaks pdb.set_trace()

245 views
Skip to first unread message

Daniel Brown

unread,
Apr 11, 2007, 2:17:24 PM4/11/07
to nose-users
I often set manual break points with `pdb.set_trace()`, but nose hangs
when it encounters this. Any idea why? Is it intentional?

jason pellerin

unread,
Apr 11, 2007, 3:53:42 PM4/11/07
to nose-...@googlegroups.com
On 4/11/07, Daniel Brown <jdan...@gmail.com> wrote:
>
> I often set manual break points with `pdb.set_trace()`, but nose hangs
> when it encounters this. Any idea why? Is it intentional?

It's probably the output capture -- it's not hung, but the prompt was
written to a stream that's not going to stdout. Internally nose turns
off capture before calling pdb, I'd think you should be able to do the
same by wrapping the call in something like:

def trace():
tmp = sys.stdout
sys.stdout = sys.__stdout__
pdb.set_trace()
sys.stdout = tmp

JP

stephen emslie

unread,
Jun 28, 2007, 12:25:13 PM6/28/07
to nose-...@googlegroups.com
running nosetests with -s or --nocapture prevents this. Thats how I
debug with pdb.
Reply all
Reply to author
Forward
0 new messages