我尝试使用来自http://docs.python.org/library/doctest.html的示例中的 doctest
但是当我跑步时
python example.py -v
我明白了
Traceback (most recent call last):
File "example.py", line 61, in <module>
doctest.testmod()
AttributeError: 'module' object has no attribute 'testmod'
但我可以在 python 交互式 shell 中导入 doctest 并启用 doctest.testmod() 以及。我在谷歌搜索并没有找到解决方案。
Max OSX 上的 Python 版本为 2.5.1