fanxianhua

 

 

 

 

 

指定--clean-alluredir参数清空上一次执行记录:

  如果我们想每次执行用例的时候都生成新的测试报告,那么我们可以在命令中加上--clean-alluredir参数。

我们先来看一下跟报告相关的三个参数,命令行中使用pytest -h查看:

 

 

  •  --alluredir=DIR:指定测试报告的生成路径;
  • --clean-alluredir:如果已经存在报告,那就先清空,然后再生成新的测试报告;
  • --allure-no-capture:不添加pytest捕捉的logging/stdout/stderr到测试报告中;

我们加上--clean-alluredir参数重新执行下测试用例:

 

if __name__ == "__main__":
pytest.main([\'testlogin.py\',\'-s\',\'--alluredir\',\'../report/tmp\'])
os.system(\'allure generate ../report/tmp -o ../report/report --clean-alluredir\')

分类:

技术点:

相关文章:

  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-12-18
  • 2021-12-05
猜你喜欢
  • 2021-12-23
  • 2021-12-23
  • 2021-12-23
  • 2021-12-23
  • 2021-10-10
  • 2022-12-23
相关资源
相似解决方案