一个改进unittest输出的简单模块。

unittest-prettif的Python项目详细描述


单元测试美化

licensepypi versionpython versionsBuild StatusCode covarage

改进unittest输出的简单模块。

您喜欢哪种unittest输出?

如果你喜欢右边的那个,这个模块是给你的。

unittest prettify旨在成为一组工具来改进unittest库输出。

主要功能

  • 更改类和方法级别中的测试描述颜色。
  • 支持像Django这样使用unittest的库。

安装它

pip install unittest-prettify 

使用它

更改整个测试用例的颜色:

test_1()test_2()将从类定义继承绿色。

importunittestfromunittest_prettify.colorizeimport(colorize,GREEN,)@colorize(color=GREEN)classFoo(unittest.TestCase):deftest_1(self):"""This test comment should be with the Class color set as GREEN"""deftest_2(self):"""This test comment should be with the Class color set as GREEN"""

更改特定测试的颜色:

test_1()将从类定义继承绿色,但是test_2()将用红色覆盖颜色。

importunittestfromunittest_prettify.colorizeimport(colorize,GREEN,RED,)@colorize(color=GREEN)classFoo(unittest.TestCase):deftest_1(self):"""This test comment should be with the Class color set as GREEN"""@colorize(color=RED)deftest_2(self):"""This test comment should be RED"""

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在删除后修复recyclerView中的项目重复?   java如何在Android中使用Handle而不增加内存   java(i>>>距离)是如何工作的   java如何在菜单项操作之后删除JTabbedPane的内容   springintermediatejavax。ejb。EJBException:java。Jboss应用程序中的lang.NullPointerException   Java:派生类中的方法链接   java InputListener不适用于正交摄影机和角色   java不能写这个方法吗?   java为什么Apache Kafka消费者不使用来自主题的消息?   使用scanner Java从文本文件填充二维数组   爪哇在会场内放置标记   maven合并了2个Java web应用程序   Java中注释处理的缺点是什么?   java创建在JFrame中绘制矩形和圆形的方法?   java LibGDX应用程序挂起在initializeglfw()上   唯一包含密钥但在不同字段上排序的java集   jboss在使用Infinispan中的共享文件存储时获取“java.io.IOException:不支持的协议版本22”   JavaEclipse似乎不想编译我的类的新版本。即使在(我认为)修复它之后,我也会遇到同样的错误