Django Tests Printing instead of Returning Results
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.
Aren't you supposed to show the expected result when running tests through Django, like the following:
"""
>>> g = 5
>>> g == 5
True
"""
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
精彩评论