目录
pytest-HTML是一个插件,pytest用于生成测试结果的HTML报告。兼容Python 2.7,3.6
1、命令安装pytest-HTML
$ pip install pytest-html
2、命令查看html报告
$ pytest --html=report.html
找到需要执行pytest用例的目录进行cmd,cmd环境下执行指令:pytest --html=report.html
执行完之后,在当前目录会生成一个report.html的报告文件,显示效果如下: