allure-pytest最全

allure-pytest 环境准备

windows环境相关:

python 3.6版本
pytest 4.5.0版本
allure-pytest 2.8.6 最新版

使用pip安装pytest和allure-pytest,加上--index-url地址,下载会快一些

pip install pytest==4.5.0 --index-url https://pypi.douban.com/simple
pip install allure-pytest==2.8.6 --index-url https://pypi.douban.com/simple

安装完成之后,打开一个你之前写的pytest脚本,看能不正常使用,如果报错:AttributeError: module 'allure' has no attribute 'severity_level'
这个是之前 pytest-allure-adaptor 这个插件与 allure-pytest 不能共存,卸载掉 pytest-allure-adaptor

pip uninstall pytest-allure-adaptor

allure命令行工具

allure是一个命令行工具,需要去github上下载最新版https://github.com/allure-framework/allure2/releases

allure-pytest最全_第1张图片
image

下载完成之后,解压到本地电脑

allure-pytest最全_第2张图片
image
allure-pytest最全_第3张图片
image

把bin目录添加到环境变量Path下

allure-pytest最全_第4张图片
image

你可能感兴趣的:(allure-pytest最全)