pytest+allure环境别人电脑运行正常,自己运行不正常几种情况

1. AttributeError:'module’ object has no attribute 'severity_level'

之前运行都是正常的,想弄allure报告,就使用pip install allure-pytest 命令安装了,其实该命令的作用是会把你当前版本的pytest卸载掉,然后安装

allure-python-commons,pytest,allure-pytest 最新版本;执行时就会出以上问题;  

然后我以为是allure的问题就把allure-python-commons 以及allure-pytest卸载了,再运行就出现了问题2

2. pluggy.manager.PluginValidationError: unknown hook 'pytest_namespace' in plugin <module 'allure.pytest_plugin' from 'd:\\python

\\lib\\site-packages\\allure\\pytest_plugin.py'>


其实以上两个问题根本原因都是同一个,pytest的版本导致的,pytest版本太新。 使用旧版本就可以解决了,切换版本步骤如下:

首先卸载新版本pytest: pip uninstall pytest
安装制定版本(可以安装你升级之前的版本),我用的是3.8.0 pip install pytest==3.8.0

安装后再次执行就可以啦!

转载于:https://www.cnblogs.com/wclcz/p/11398113.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值