背景:

一个大项目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] docker-compose MySQL8 ERROR: Different lower_case_table_names settings for server

    MySQL8 启动时 lower_case_table_names 的设置和初始值不一致时,会报 ERROR. 在 docker-compose 中,只需要在命令中加入命令选项即可,并配置一个新的 v ...

  2. [FAQ] 夏玉米 按规则查询域名靠谱吗 ?

    很早就有一个网站叫 夏玉米,可以按规则查询和注册域名,那么它真如我们想的那样 可以找到好域名吗? 虽然看起来很好用,实际上夏玉米的查询只是针对它自己的数据库,不包含未在其平台注册的域名,所以大家要失望 ...

  3. Etcd 可视化管理工具,GUI 客户端。

    Etcd Assistant--Etcd 可视化管理工具,GUI 客户端. 下载地址:http://www.redisant.cn/etcd 主要功能: 支持多标签页,同时连接到多个集群 以漂亮的格式 ...

  4. github只下载某个文件或文件夹(使用GitZip插件)

    安装GitZip插件 (此安装过程需要梯子(不懂"梯子",百度一下就明白)) 1. 打开插件管理页面 方法一:打开Chrome浏览器(Edge浏览器同理),在Chrom地址栏输入c ...

  5. 小伙伴说VuePress太简洁了,还有没有其他博客推荐?

    写在前面 自从上一篇文章发出来之后,不少小伙伴开始用VuePress搭建自己的个人网站. 如果小伙伴也想用VuePress零代码零成本搭建个人网站,可以看过来 传送门 怎么零代码零成本搭建个人网站 当 ...

  6. 01、Windows 排查

    Windows 分析排查 分析排查是指对 Windows 系统中的文件.进程.系统信息.日志记录等进行检测,挖掘 Windows 系统中是否具有异常情况 1.开机启动项检查 一般情况下,各种木马.病毒 ...

  7. kettle使用2-增量插入

    1.新建转换 2.在DB连接中,新建2个数据库连接 3.在输入中,新建:表输入 4.在输入中,新建:表输入 5.在输出中,新建:表输出

  8. HDU-Employment Planning题解

    题目在这里 -------------------------------- Employment Planning 简单的一道dp 关键的点在于想到用枚举实现各种情况的讨论 关键的注释写在代码里了 ...

  9. C# 数独 解法

    按照人的思维来做的. MyPos 就是 数组 行 列值. public class CalcShuDu { public int[][] IArrSd; public int IBlankCount; ...

  10. Go post重定向的两种方式

    1.Location 2.http.Redirect 代码 /index -> /login -> /home package main import ( "fmt" ...