pytest-html报告

1、打开cmd,cd到需要执行pytest用例的目录,执行指令:pytest --html=report.html

2、指定报告的path

执行指令: pytest --html=./report/report.html   #相对路径,也可指定绝对路径

 

报告独立显示

上面方法生成的报告,css是独立的,分享报告的时候样式会丢失,为了更好的分享发邮件展示报告,可以把css样式合并到html里:

pytest --html=report.html --self-contained-html

posted @ 2020-06-28 23:05  wakey  阅读(185)  评论(0编辑  收藏  举报