鼻子是单元测试的扩展吗?
我将使用鼻子作为在我相当大的项目中已经实现的单元测试类上进行测试发现的方法。我的印象是,nose 主要用于测试发现和测试运行(也可以并行)。但我看到这个问题就好像nose是unittest的替代品。有人可以澄清他们在这里的意思吗?我是否缺少鼻子提供的一些核心功能?
顺便说一句,py.test 和鼻子有什么区别?
I'm about to use nose as a method for test discovery on my already implemented unittest classes in my rather large project. I was under the impression that nose is just used primarily for test discovery and test running (in parallel as well). But I see this question as if nose is a replacement for unittest. Can someone clarify what they meant here? Am I missing some core piece of functionality that nose provides?
As a side note, what is the difference between py.test and nose?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
鼻子的文档说:
如果您看一下代码,你会看到unittest是依赖项之一。
因此,据我所知,nose 是运行测试的一种替代方案,但不能替代unittest 模块(这里稍微涉及一下语义,但我希望这足够清楚)。
The docs for nose say:
If you take a peek at the code, you will see that unittest is one of the dependencies.
So - to the best of my knowledge - I would say that nose is a drop-in alternative for running tests, but not an replacement to the unittest module (playing a bit with the semantics here, but I hope this is clear enough).
Nose 模仿 py.test 的行为。他们在网站上是这么说的:
Nose是unittest的扩展添加问题 https://stackoverflow.com/questions/5696884/python-nose-vs-unittest。
Nose mimics behavior of py.test. That's what they say on their website:
Nose is an extension of unittest and adds the features listed in issue https://stackoverflow.com/questions/5696884/python-nose-vs-unittest.