pytest生成html报告-使用pytest-html插件方式

使用pytest-html插件方式生成html文件报告:

1、安装第三方库

pip install pytest-html

 通过pip list 可查看已安装的第三库

2、pytest --html=文件名.html

pytest --html=result_report.html 执行用例并生成该文件,如下图:(如果文件没有看到,刷新下当前目录即可)

 使用浏览器打开该文件,如下图:

原文地址:https://www.cnblogs.com/sanyvaelailai/p/14318153.html