pytest 常用插件安装

1、html报告插件:

  pip install pytest-html

  pytest可以生产多种样式的报告:

    ⑴ 生成junitXML 格式的测试报告: --junitxml=path

    ⑵ 生成result log 格式的测试报告: --resultlog=report\xxx.txt

    ⑶ 生成html 格式的测试报告: --html=report\xxx.html

2、重运行插件:

  插件名称:rerunfailures

  安装方法:pip install pytest-rerunfailures

  使用方式:

    ⑴ pytest --reruns 重试次数

    例:pytest --reruns 2    表示:运行失败的用例可以重新运行2次

    ⑵ pytest --reruns 重试次数 --reruns-delay 次数之间的延时设置(单位:秒)

    例:pytest --reruns 2 --reruns-delay 5    表示:失败的用例可以重新运行2次,每次间隔5s

    

 

相关文章

目录1、前言2、mark的使用(一)注册自定义标记(二)在测试...
用例执行状态用例执行完成后,每条用例都有自己的状态,常见...
什么是conftest.py可以理解成一个专门存放fixture的配置文件...
前言pytest默认执行用例是根据项目下的文件名称按ascii码去收...
前言:什么是元数据?元数据是关于数据的描述,存储着关于数...