pytest-allure测试报告

该类型的警告大多属于版本更新时,所使用的方法过时的原因,可以在该方法的说明出查找替换的方法

1、安装allure

a)下载allure.zip https://github.com/allure-framework/allure2 

b)添加allure到环境变量PATH(安装路径allurein)

c)  验证allure环境配置成功:命令行cmd,输入allure:

2、pytest安装插件

pip install allure-pytest

3、pytest生成allure测试报告的命令参数

--alluredir=XX/my_allure_results

4、查看allure的测试报告命令

allure serve [allure报告目录]

 常见问题解决:

1、运行报错,提示:“ValueError: option names {'--alluredir'} already added”

产生问题的主要原因

   pytest-allure-adaptor与allure-pytest的alluredir都被引用造成冲突

解决办法

   需要卸载不用的包 :pip uninstall pytest-allure-adaptor

2、pytest安装的插件:有2种 pip install pytest-allure-adaptor、pip install allure-pytest
原文地址:https://www.cnblogs.com/xyao1/p/10930457.html