views:

82

answers:

0

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......

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 .... , and then nothing and not responsive to keyboard input.

Is this a problem with readline?