Skip to main content
 首页 » 编程设计

python之Nosetests 缺少命令行选项

2025年02月15日7mengfanrong

使用 nose 1.3.7 和命令行选项后的文档列表

--xunit-prefix-with-testsuite-name Whether to prefix the class name under test with testsuite name. Defaults to false.

文档可用于: https://nose.readthedocs.io/en/latest/usage.html

但是在尝试使用它时出现错误:

nosetests: error: no such option: --xunit-prefix-with-testsuite-name

有什么我想念的吗?

请您参考如下方法:

经过一些研究,我注意到它不在 1.3.7 版本的 nose 中。

如果您查看他们的 github 存储库,该选项是在 2015 年 11 月添加的。

https://github.com/nose-devs/nose/commits/master/nose/plugins/xunit.py

如果您查看他们的发布,您会发现 1.3.7 于当年 6 月早些时候发布。

https://github.com/nose-devs/nose/releases/tag/release_1.3.7

我注意到当您这样做时该选项已启用

nosetests --with-xunit --xunit-testsuite-name=MYTESTSUITE