安装使用

1、安装allure

下载allure包

  解压

,配置环境变量

  source ~/.bash_profile

  allure --version

2、安装allure-pytest

  pip install allure-pytest

3、使用

  执行:python do_test.py

  # --clean-alluredir: 表示每次运行前会清理上一次的json报告

pytest allure_python

pytest allure_python_02

4、allure注解说明

pytest allure_配置环境变量_03

 参考:https://zhuanlan.zhihu.com/p/555114726  

 

问题

1、执行报错:error: unrecognized arguments: --alluredir

1、pip list | grep allure-pytest 确认是否已成功安装allure-pytest插件

2、检查allure-pytest版本与python版本是否兼容

  2、执行报错:Allure comond not found

 

3、如何把pytest.mark.parametrize参数传递给allure.severity

pytest allure_python_04

参考:

   4、【接口自动化测试】python Pytest(1) 框架介绍 插件介绍 fixture 装饰器 allure 报告 yaml 数据驱动

    参考:https://zhuanlan.zhihu.com/p/623609865?utm_id=0