gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 15:28:23 25 4
gpt4 key购买 nike

我最近从 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com