Python 单元测试有可视化工具吗?
我正在编写相当多的单元测试,并使用 nosetests 来运行它们。 Nose 确实让运行测试变得更好、更容易,但在最好的情况下,输出可能会非常混乱,而在其他情况下,输出可能会完全混乱,具体取决于警告和错误。
我想知道是否有任何视觉工具可以包裹鼻子,以便反馈更干净。显示测试名称、运行时间并用颜色指示成功/失败状态的结果网格将是一个巨大的视觉帮助。更好的是,如果它可以根据具体情况拆分错误消息和回溯,那么当大量测试因重大更改而失败时,它确实会减少混乱的数量。
这听起来像是一个愿望清单,但是是否有任何接近此的东西存在呢?
I'm writing quite a few unit tests and using nosetests to run them. Nose certainly makes it nice and easy to run tests, but the output can be pretty cluttered at the best of times, and a downright mess at others, depending on warnings and errors.
I was wondering if there are any visual tools that wrap nose so that the feedback cleaner. A results grid showing test names, run times and indicating success/failure status with colours would be a huge visual aide. Better still, if it could split up the error messages and tracebacks on a case by case basis, it would really cut down on the amount of clutter when a large number of tests fail on a major change.
This is starting to read like a wishlist, but does anything even close to this exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这里有一个非常类似的问题。
看起来并没有一个用于鼻子测试的标准化 GUI(例如,仅针对 python 接口进行标准化)。似乎有一些用于鼻子测试的 GUI 插件,具体取决于您使用的 IDE - 快速搜索会出现
然而,还有许多其他基于 GUI 的 Python 单元测试框架 - 您尝试过 PyUnit 吗?
There's a very similar question here.
It doesn't look like there's a standardized GUI for nosetests (as in, standardized for just the python interface). There seems to be a few GUI plugins for nosetests depending on which IDE you're using - a quick search brought up this link for Komodo.
However, there are many other GUI based unit testing frameworks out there for Python - have you tried PyUnit?
好吧,你可以做的是使用 jenkins 集成服务器,我们使用它与 py.test 和 phpunit 一起使用(将其与任何其他测试框架一起使用非常简单),它为我们提供了一些奇特(且有用!)的图表,其中包含
这里 你有一个如何配置 hudson 的示例(郑重声明,jenkins 是 hudson 的一个分支,所以说明是仍然有效:),以便提供您的愿望清单中的元素。
一个更简单的选择是使用 PyCharm 等 IDE,它与鼻子测试集成,并会告诉您哪些测试通过/失败及其时间,但是,jenkis 存储历史数据。
祝你好运 :)
Well, what you can do is to use the jenkins integration server, we use it with py.test and phpunit (it is really simple to use it with any other testing framework), it provides us some fancy (and useful!) graphs containing
Here you have an example of how to configure hudson (for the record, jenkins is a fork of hudson, so the instructions are still valid :), in order to provide the elements from your wishlist.
An easier option is to use a IDE as PyCharm, it has integration with nosetests, and will tell you which tests passed/failed and its times, however, jenkis stores historical data.
Good luck :)
您是否看过Nose 插件页面?快速浏览一下,至少有几个声称他们可以提供 GUI 界面。
Have you taken a look at the Nose plugins page? A quick glance revealed at least a couple that stated they could provide a GUI interface.