tags:

views:

40

answers:

2

I'm suddenly running into an issue where docstring tests like this:


"""

>>> g = 5

>>> g

5

"""

Would run and look like this:

...
Installing Index for ModeName

....

5...

Failed example:

 g

Expected:

5

Got nothing

In short, it's printing out the expected results instead of returning them! What would cause something like this? I've been digging for hours.

A: 

Aren't you supposed to show the expected result when running tests through Django, like the following:

"""
>>> g = 5

>>> g == 5
True
"""
Thierry Lam
A: 

It eventually started working again though I'm not 100% sure why. I think there was an IO issue with setting the stdio

import sys sys.stdout = sys.stdout sys.stderr = sys.stderr

Dave