pytest---allure(mac版本)

1,安装allure

  brew install allure

  因为网速慢导致安装失败,可以尝试下面的方法,

  https://blog.csdn.net/chenmiao207/article/details/104994194

2,安装allure-pytest

  pip3 install allure-pytest 

3,pytest添加参数--alluredir,生成测试json/txt

  python3 -m pytest --alluredir=report app 

4,转换json/txt报告为html报告

  allure generate

  直接在默认浏览器中打开报告

  allure serve report

  转换为本地html文件

  allure generate --clean report -o 报告存储路径

  

原文地址:https://www.cnblogs.com/myy-py/p/13425018.html