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 ...
随机推荐
- 编码原则 : DRY, KISS, YAGNI, S.O.L.I.D
Dont Repeat Yourself. Keep is Simple, Stupid. You Ain't Gonna Need It. 你不需要它 ( 不试图添加你认为以后可能需要的代码,适可 ...
- spannerlib优雅的go异常处理
蹩脚的go 异常处理 一般写go的人,如果他不是写算法,正常写业务代码的话,可能都会为优雅的异常处理而烦恼,因为脑子抽筋的go设计者们,总是感觉语法糖是一种很低级的东西.但是在我们大多数公司的业务逻辑 ...
- 手把手搭建WebSocket多人在线聊天室(SpringBoot+WebSocket)
前言 本文中搭建了一个简易的多人聊天室,使用了WebSocket的基础特性. 源代码来自老外的一篇好文: https://www.callicoder.com/spring-boot-websocke ...
- SAP Adobe Form 教程六 FormCalc和JavaScript的实践
前文: SAP Adobe Form 教程一 简单示例 SAP Adobe Form 教程二 表 SAP Adobe Form 教程三 日期,时间,floating field SAP Adobe F ...
- Competition Set - AtCoder I
这里记录的是这个账号的比赛情况. ARC172 2024-2-18 Solved:4/6 D(Hard-,2936) 给定所有数对 \((i,j),1\le i\lt j\le n\) 的一个排列 \ ...
- AI编译器CINN v.s TVM 中CodeGen 源码解读
如下的技术点梳理仅以「日常优化工作」为牵引点,涉及哪个模块,就具体去看哪个模块的代码. 一.CINN 框架 CINN 中CodeGen之后的代码编译主要交给了Compiler类来负责.核心的函数主要是 ...
- PostgreSQL数据库管理工具pgAdmin4界面如何设置为中文显示
首发微信公众号:SQL数据库运维 原文链接:https://mp.weixin.qq.com/s?__biz=MzI1NTQyNzg3MQ==&mid=2247485130&idx=1 ...
- Java异步编程CompletableFuture
Java 通过多线程可以实现异步编程,下面是一个使用 Java 多线程实现异步编程的示例: public class AsyncDemo { public static void main(Strin ...
- 4G EPS 第四代移动通信系统
目录 文章目录 目录 4G EPS 4G EPS 4G(the 4th generation mobile communication technology,第四代移动通信技术)提供了 3G 不能满足 ...
- git使用其它
创建目录 切换到本地新建的dev分支,目录下还是这个目录下的文件.我push一下,指定推送到dev分支,那么dev分支就在远程仓库同步创建,并且文件也是本地这个目录下的文件,一样的. 好像得改个名字才 ...