pytest常用插件

1.pytest-html: 生成测试报告
  安装:pip3 install pytest-html
  使用:跟在命令行里,pytest 测试文件  --html=路径/xx.html


2.pytest-ordering: 控制测试函数运行顺序
  使用:@pytest.mark.run(order=x)
  x:
  1.全为正数 或者 全为负数 值越小 优先级越高,意味着最先执行
  2.正数和负数同时存在,正数优先级高
  3.值为负数时,优先级低于没被标记的测试方法
  4.值为正数时,优先级高于没被标记的测试方法


3.pytest-rerunfailures : 失败测试函数重试机制

  使用:在命令行参数中配置:—reruns n
  n:重试次数