pytest执行_allure报“AttributeError: module 'allure' has no attribute 'severity_level'”
背景:
一个大项目A,需要项目B作为源码,即pycharm的 source_root
问题:
项目B,执行pytest.main([pytest命令]),控制台报错“AttributeError: module 'allure' has no attribute 'severity_level'”,往上看报错的路径是项目A下报错,导致项目B中是用allure出问题
具体问题:
1、项目B,点击allure,跳转到_init_.py文件,文件为空
2、@allure.feature这个标签提示找不到,from allure import severity, severity_level导入报错
正常使用的allure:
1、点击allure,跳转到的是allure.py这个文件
2、allure的标签,如feature、story正常使用,
3、from allure import severity, severity_level,import正确
解决方法:
1、因为大项目是用的是pycharm的venv的虚拟环境,要到虚拟的script进行操作
大部分百度的答案:
1、卸载:pip uninstall pytest-allure-adaptor,这个包和allure-pytest冲突了
2、按照步骤1,发现虚拟环境下,根本没有安装这个pytest-allure-adaptor,报错还是存在
3、参考一个博主的,现在虚拟环境下安装,然后再卸载,重启pycharm,重新加载,问题解决(猜测可能是因为依赖于pytest-allure-adaptor的某些东西,需要先安装才可以)
pytest执行_allure报“AttributeError: module 'allure' has no attribute 'severity_level'”的更多相关文章
- 如果生成allure报告过程中报错AttributeError: module 'allure' has no attribute 'severity_level'
1.pip uninstall pytest-allure-adaptor 2.pip install allure-pytest 3.搞定 快去吃饭吧
- 报错问题: AtrributeError:module ‘allure’ has no attribute ‘’severity_level’
问题:执行命令报错:pytest -s -q --alluredir report 报错问题: AtrributeError:module 'allure' has no attribute ''se ...
- Python报AttributeError: module 'string' has no attribute 'join'解决方法
报:AttributeError: module 'string' has no attribute 'join' 属性错误:模块"string"没有属性"join&qu ...
- 运行os.fork()报AttributeError: module 'os' has no attribute 'fork'
现象 报错代码 def handle(s, c, db): pid = os.fork() if pid == 0: s.close() do_child(c, db) sys.exit() else ...
- Python 3.6安装yaml时报"AttributeError: module 'pip' has no attribute 'main'"和“Non-zero exit code”错误
1.Python 3.6安装yaml时一开始报AttributeError: module 'pip' has no attribute错误,根据网上提供的解决方法修改Pycharm安装目录D:\Pr ...
- AttributeError: module 'datetime' has no attribute 'now'
在用时间转化时,一直报AttributeError: module 'datetime' has no attribute 'now', 我用的 import datetime datetime ...
- [转载]pytest报AttributeError: module ‘pytest‘ has no attribute ‘main‘
转自:https://blog.csdn.net/yinying12/article/details/110522989 pytest报AttributeError: module 'pytest' ...
- python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?
python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...
- 安装pandas报错(AttributeError: 'module' object has no attribute 'main')
在pycharm中安装pandas出现报错:AttributeError: 'module' object has no attribute 'main', 刚开始以为是pip的版本太旧了,于是乎将其 ...
- 在运行create_list.sh时候报错:AttributeError: 'module' object has no attribute 'LabelMap'
Traceback (most recent call last):File "/opt/xuben-project/caffe/data/VOC0712/../../scripts/cre ...
随机推荐
- [Blockchain] 以太坊主流测试网 ropsten 和 kovan 的区别 以及 如何选择
ropsten 采用 POW (Proof-of-Work)共识机制,挖矿难度系数非常低,容易被攻击,不够低碳环保. kovan 采用 POA (Proof-of-Authority)共识机制,不需要 ...
- SQL SERVER数据库存储过程加密
CREATE PROCEDURE [dbo].[kytj_Base_Worker] WITH ENCRYPTION AS SELECT u.worker_number, u.worker_name, ...
- nim 2. 变量与函数
对于系统的学习,官网上的相应的资料, 这里通过一个简单的例程,演示一下. 这个例程里有一个根据半径计算圆面积的方法,以及调用的示例: 演示代码 1 #计算圆的面积 2 proc calcArea(r: ...
- 如何使用Python和Plotly绘制3D图形
本文分享自华为云社区<Plotly绘制3D图形> ,作者:柠檬味拥抱. 在数据可视化领域,三维图形是一种强大的工具,可以展示数据之间的复杂关系和结构.Python语言拥有丰富的数据可视化库 ...
- 【活动访谈】发力数字基座 推动物联创新—航天科技控股集团AIRIOT4.0平台发布会活动专访
近日,由航天科技控股集团股份有限公司主办的"数字基座 智慧物联-AIRIOT4.0平台发布会"在北京圆满落幕.航天三院科技委总工程师王连宝应邀出席本次会议并接受媒体采访,共同参与访 ...
- 文件系统(四):FAT32文件系统实现原理
FAT32是从FAT12.FAT16发展而来,目前主要应用在移动存储设备中,比如SD卡.TF卡.隐藏的FAT文件系统现在也有被大量使用在UEFI启动分区中. 为使文章简单易读,下面内容特意隐藏了很多实 ...
- C# WPF 坦克大战
wpf写的.主要是Canvas做画布 和类似的Rectangle的自定义类 采用了画面帧的思想,子弹 坦克移动 效果 都是 在主界面用一个定时器 循环,每秒60帧,这样做的好处,对比我之前做的炸弹人游 ...
- 使用 Microsoft Edge WebDriver 自动执行和测试 WebView2 应用 Selenium
https://learn.microsoft.com/zh-cn/microsoft-edge/webview2/how-to/webdriver
- 使用Harbor作为Rainbond默认容器镜像仓库,扩展Rainbond镜像管理能力
Rainbond是一体化的云原生应用管理平台,它提供"以应用为中心"的抽象,使用者不需要学习K8s和容器,平台将K8s和容器封装在内部,这种封装方式能极大提高使用的易用性和安装的便 ...
- k8s中的pod更新策略
StatefulSet(有状态集,缩写为sts)常用于部署有状态的且需要有序启动的应用程序,比如在进行SpringCloud项目容器化时,Eureka的部署是比较适合用StatefulSet部署方式的 ...