我遇到麻煩與doctest一起使用扭曲。我想open a file像這樣: from __future__ import print_function
from twisted.internet.defer import Deferred
from twisted.internet.fdesc import readFromFD, setNonBlocking
from twisted.i
我有以下的doctest書面x.doctest: This is something:
>>> x = 3 + 4
foo bar something else:
>>> from __future__ import division
>>> y = 15
>>> z = int('24')
>>> m = z/y
>>> pri
我正在嘗試使用python doctests來測試打印在函數中的錯誤消息。下面是我的代碼 import sys
def get_values(vals=[]):
"""
Should split key:val and give values
>>> get_values(["abc"])
Error: could not get the values