背景:

一个大项目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. [Linux] 启动管理: 运行级别

    Link:https://www.cnblogs.com/farwish/p/14983932.html

  2. WPF 警惕使用 Dispatcher.InvokeShutdown 方法退出应用 将不触发 Application.Exit 事件

    这是一个比较让人困惑的一个点,我一直都以为 Dispatcher.InvokeShutdown 和 Application.Current.Shutdown 是完全等价的.但是后面发现了其实这两者还是 ...

  3. Linux 环境下制作 deb 软件包

    一.简介 前面的笔记中已经展示过了,怎么移植的一个工具境到 ARM 环境中,对于使用 buildroot 和 yocto 的朋友来说,此笔记就没有作用了,因为管理工具包会帮我们把这个工作处理了,就算需 ...

  4. C++编程英语词汇

    abstract抽象的 abstraction抽象性.抽象件 access访问 access level访问级别 access function访问函数 adapter适配器 address地址 ad ...

  5. 在.Net中操作redis

    在.Net中操作redis 一.环境 .Net 7 redis 7.2.4 二.所需类包 StackExchange.Redis 三.连接redis信息 appsettings.json配置redis ...

  6. 建立成功平台工程的关键:自助式 IaC

    从技术上讲,云一直都是自助式服务,但由于其在实践中的复杂性,许多开发人员并不喜欢.随着公司采用现代架构(云原生.无服务器等)和新的提供商(多云.SaaS 应用程序),以及云提供商发布更多服务,云变得更 ...

  7. SAP Adobe Form 教程四 动态隐藏和显示字段

    前文: SAP Adobe Form 教程一 简单示例 SAP Adobe Form 教程二 表 SAP Adobe Form 教程三 日期,时间,floating field 本文链接:https: ...

  8. 错误记录——mysql5.7连接失败,服务无法启动

    起因: 上周安装完mysql后,成功新建了数据库,一切都是正常的,于是就先搁置一旁.今天周一过来,却突然发现无法连接mysql了. 过程: 第一反应是服务没有启动,毕竟重启了电脑,说不定是服务没有自动 ...

  9. ORACLE查询表的DML最后时间和操作记录条数

    ORACLE查询表的DML最后时间和操作记录条数 其中user代表当前用户的.dba代表的是有dba可以看到的相关表. select * from all_tab_modifications; sel ...

  10. docker-compose 配置LNMP环境

    仓库地址: https://gitee.com/haima1004/docker-lnmp 参考文档: 视频地址: https://www.bilibili.com/video/BV1S54y1B7K ...