简体   繁体   English

为nose2输出添加颜色

[英]Add color to nose2 output

This is such a simple question, but I can't find it anywhere... how do I add color to the output of running tests with nose2? 这是一个很简单的问题,但我无法在任何地方找到它...如何使用nose2为运行测试的输出添加颜色? For example, I would like failures to show up as red. 例如,我希望失败显示为红色。

nose2 does not have colored output built in, but a popular third-party plugin named green will color the output for you. nose2没有内置的彩色输出,但是一个名为green的流行第三方插件会为你输出颜色。

It can easily be installed with pip via : pip3 install green 它可以通过pip轻松安装: pip3 install green

You can find more information on it within it's pypi page here: https://pypi.python.org/pypi/green 您可以在此处的pypi页面中找到有关它的更多信息: https//pypi.python.org/pypi/green

Their GitHub page as well: https://github.com/CleanCut/green 他们的GitHub页面也是: https//github.com/CleanCut/green

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM