python - 是否可以使用 unit2 运行 doctests

标签 python testing nose unittest2

我最近从 nose 切换到新的 unittest2 包以满足我的 python 单元测试需求。它做我想做的一切,除了我无法得到它的“发现”命令来识别我的代码中的文档测试——我仍然必须使用 Nose 来运行它们。这是没有实现还是我在这里遗漏了什么?

最佳答案

Unit2 仅发现常规 Python 测试。为了让它运行你的 doctests,恐怕你需要写一些最小的样板。此外:即将推出的插件架构将使其中一些任务的自动化变得容易。

与此同时。你可能想看看 tox(由 unittest2 创建者在此处描述)http://www.voidspace.org.uk/python/weblog/arch_d7_2010_07_10.shtml

关于python - 是否可以使用 unit2 运行 doctests,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3342193/

相关文章:

python - 多键字典不适用于某些字符串

python - 使用 Nose 的 ImportError,使用原始单元测试没有 ImportError?

python - Nosetests 缺少命令行选项

python - 在 pandas 中分割时间戳日期

python - json.dump python mysql 结果

python - 没有这样的元素 : Unable to locate element using chromedriver and Selenium in production environment

internet-explorer - IE工具栏自动化测试?

ios - 使用 Kiwi 测试 JASidePanel

testing - headless 运行 cypress.io

sqlite - 如何通过创建新数据库正确地对 sqlalchemy 模型进行单元测试(使用 Nose )