我正在使用Python库进行单元测试。我想模拟在与doctest相同的Python文件中定义的函数。MiniMock能处理这个问题吗?天真的方法失败了: raise ValueError, "Don't call me during testing!"/Versions/2.5/lib/python2.5/doctest.py", line 1212, in __run
1, 4] return [i**2 for i in range(start, end+1)]
import doctestdoctest.testmod(verbose=True, optionflags=doctest.NORMALIZE_WHITESPACE)
这导致了大约30个其他错误,我不知道如何修复它。ValueError: line 5 of the docstring
我试图编写一个doctest,但是当它们被执行时,我会得到一些错误。当我编写一个用pandas.DataFrame检索index.name的doctest时,测试失败。MRE:pandas_doctest_with_indexname (不work)pandas_doctest (Works))
"""Function with panda