背景:

一个大项目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'”的更多相关文章

  1. 如果生成allure报告过程中报错AttributeError: module 'allure' has no attribute 'severity_level'

    1.pip uninstall pytest-allure-adaptor 2.pip install allure-pytest 3.搞定 快去吃饭吧

  2. 报错问题: AtrributeError:module ‘allure’ has no attribute ‘’severity_level’

    问题:执行命令报错:pytest -s -q --alluredir report 报错问题: AtrributeError:module 'allure' has no attribute ''se ...

  3. Python报AttributeError: module 'string' has no attribute 'join'解决方法

    报:AttributeError: module 'string' has no attribute 'join' 属性错误:模块"string"没有属性"join&qu ...

  4. 运行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 ...

  5. 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 ...

  6. AttributeError: module 'datetime' has no attribute 'now'

    在用时间转化时,一直报AttributeError: module 'datetime' has no attribute 'now', 我用的 import datetime   datetime ...

  7. [转载]pytest报AttributeError: module ‘pytest‘ has no attribute ‘main‘

    转自:https://blog.csdn.net/yinying12/article/details/110522989 pytest报AttributeError: module 'pytest' ...

  8. python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?

    python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...

  9. 安装pandas报错(AttributeError: 'module' object has no attribute 'main')

    在pycharm中安装pandas出现报错:AttributeError: 'module' object has no attribute 'main', 刚开始以为是pip的版本太旧了,于是乎将其 ...

  10. 在运行create_list.sh时候报错:AttributeError: 'module' object has no attribute 'LabelMap'

    Traceback (most recent call last):File "/opt/xuben-project/caffe/data/VOC0712/../../scripts/cre ...

随机推荐

  1. [FAQ] 阿里云一口价域名购买之后在哪里看

    进入控制台,产品和服务中找到"域名",进去后在左侧菜单有 "已买到的域名". 如图: Link:https://www.cnblogs.com/farwish/ ...

  2. 12.prometheus监控之Domain域名过期监控

    一.域名过期时间监控 域名的监控通过domain_exporter来完成 domain_exporter:https://github.com/caarlos0/domain_exporter/rel ...

  3. 构造照亮世界——快速沃尔什变换 (FWT)

    博客园 我的博客 快速沃尔什变换解决的卷积问题 快速沃尔什变换(FWT)是解决这样一类卷积问题: \[c_i=\sum_{i=j\odot k}a_jb_k \] 其中,\(\odot\) 是位运算的 ...

  4. 虚拟服务器VirtualBox不要太好用

    在工作和学习前端的路上遇到过太多的坑,就是跳进坑里了,还要勇敢的爬起来. 本章真的想真心实意的推荐一下,超好用的虚拟服务器.你还在纠结window环境和Mac本的区别吗?是不是上班用的window电脑 ...

  5. 数据转换3-航拍的osgb格式数据转成3dtile格式

    选择的是包含所有 osgb 文件夹的 Data 文件 文件添加成功之后,空间参考,零点坐标等会根据文件自动生成,需要更改点击设置选择即可 存储类型:选择"散列",如果没有注意到,C ...

  6. Ajax 请求总共有八种 Callback

    1)onSuccess 2)onFailure 3)onUninitialized 4)onLoading 5)onLoaded 6)onInteractive 7)onComplete 8)onEx ...

  7. 使用 Splashtop 启用员工远程访问

    使员工进行远程工作似乎是一项耗时.不安全且昂贵的任务.但是,借助 Splashtop,您可以快速.轻松.安全地使您的员工从任何位置以最高 价值远程访问其工作站. ​ 如何使用 Splashtop 启用 ...

  8. 删除字符串A中与字符串B相同的字符

    /** * file name:DelDestChar.c * author : liaojx2016@126.com * date : 2024-05-06 * function : Delete ...

  9. centos安装kvm博客

    一 centos如何安装kvm https://blog.csdn.net/yulsh/article/details/91790804

  10. linux curl命令的重要用法:发送GET/POST请求,获取网页内容

    curl是一个利用URL规则在命令行下工作的文件传输工具,可以说是一款很强大的http命令行工具.它支持文件的上传和下载,是综合 传输工具,但按传统,习惯称url为下载工具. #使用curl发送GET ...