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

 

posted @ 2016-11-17 11:31  GreatK  阅读(250)  评论(0编辑  收藏  举报