[IPython-user] Why is ipdb not diplaying STOUT properly?
Bryan Wheelock
bryan.wheelock@gmail....
Wed Mar 24 10:05:09 CDT 2010
I can't figure out why ipdb is not displaying stout properly.
I'm trying to debug why a test is failing and so I attempt to use ipdb
debugger.
For some reason my Input seems to be accepted, but the STOUT is not
displayed until I (c)ontinue.
Is this something broken in ipdb?
It makes it very difficult to debug a program.
Below is an example ipdb session, notice how I attempt to display the values
of the attributes with:
user.is_authenticated()
user_profile.reputation
user.is_superuser
The results are not displayed until 'begin captured stdout '
In [13]: !python manage.py test
Creating test database...
< SNIP remove loading tables >
nosetests
...E..> /Users/Bryan/work/APP/forum/auth.py(93)can_retag_questions()
92 import ipdb; ipdb.set_trace()
---> 93 return user.is_authenticated() and (
94 RETAG_OTHER_QUESTIONS <= user_profile.reputation <
EDIT_OTHER_POSTS or
user.is_authenticated()
user_profile.reputation
user.is_superuser
c
F> /Users/Bryan/work/APP/forum/auth.py(93)can_retag_questions()
92 import ipdb; ipdb.set_trace()
---> 93 return user.is_authenticated() and (
94 RETAG_OTHER_QUESTIONS <= user_profile.reputation <
EDIT_OTHER_POSTS or
c
.....EE......
<SNIP more failed tests>
======================================================================
FAIL: test_can_retag_questions
(APP.forum.tests.test_views.AuthorizationFunctionsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/Bryan/work/APP/../APP/forum/tests/test_views.py", line 71, in
test_can_retag_questions
self.assertTrue(auth.can_retag_questions(user))
AssertionError:
-------------------- >> begin captured stdout << ---------------------
ipdb> True
ipdb> 4001
ipdb> False
ipdb>
--------------------- >> end captured stdout << ----------------------
----------------------------------------------------------------------
Ran 20 tests in 78.032s
FAILED (errors=3, failures=1)
Destroying test database...
In [14]:
Here is the actual test I'm trying to run:
def can_retag_questions(user):
"""Determines if a User can retag Questions."""
user_profile = user.get_profile()
import ipdb; ipdb.set_trace()
return user.is_authenticated() and (
RETAG_OTHER_QUESTIONS <= user_profile.reputation <
EDIT_OTHER_POSTS or
user.is_superuser)
I've also tried to use pdb, but that doesn't display anything. I see my test
progress ....<stops> , and then nothing and not responsive to keyboard
input.
Is this a problem with readline?
--
The best marketing related articles are at
http://www.InstantDirectMarketing.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20100324/fb7dfabb/attachment.html
More information about the IPython-user
mailing list