Python: 关于nose

1. 使用rednose增强输出

pip install rednose
nosetests --rednose tests

2. 使用coverage

pip install coverage
nosetests --with-coverage --cover-html tests

随后可以在cover目录中查看生成的html报表

3. nose测试中默认捕获测试通过的case中的print输出,如果想要输出结果,可以加入以下参数

nosetests --nocapture mytest.py
原文地址:https://www.cnblogs.com/ilovewindy/p/6073116.html