>> g = 5 >>> g 5 \"\"\" Would run and look like this:" />
开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜