背景:

一个大项目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. dotnet 在国产 UOS 系统利用 dotnet tool 工具做文件传输

    我在一台设备上安装了 UOS 系统,但是我如何在我的主开发设备上和 UOS 系统传输文件?通过 dotnet tool 工具可以完成大部分的工作,当然,使用 dotnet tool 不仅做文件传输,还 ...

  2. C语言程序设计-笔记3-循环结构

    C语言程序设计-笔记3-循环结构 例4-1  用格雷戈里公式求给定精度的π值.使用格雷戈里公式求π的近似值,要求精确到最后一项的绝对值小于给定精度eps. =1--+-+- #include<s ...

  3. 由初中生实现的 Windows 12 网页版!

    大家好,我是 Java陈序员. 这几天,逛 Github 的时候,看到了一个项目 win12 -- 仿 Windows12 网页版!被它实现的页面功能震撼到了,大家可以一起来感受下! 首先是登录页面. ...

  4. Go语言连接Redis之go-redis使用指南

    参考下面的连接: https://mp.weixin.qq.com/s?__biz=MzU5MjAxMDc1Ng==&mid=2247483899&idx=1&sn=b103c ...

  5. ansible(17)--ansible的archive和unarchive模块

    1. archive模块 功能:在远端主机打包与压缩: 主要参数如下: 参数 说明 path 要压缩的文件或目录 dest 压缩后的文件 format 指定打包压缩的类型:bz2.gz.tar.xz. ...

  6. 纯JavaScript实现“返回顶部”和“评分”,“分享”等小功能

    1.返回顶部功能的实现 <!DOCTYPE html> <html> <head> <title>Back to Top</title> & ...

  7. Vue3学习(二十四)- 文档页面功能开发

    写在前面 这部分真的感觉超级难,其实也不能说难,主要是真的想不到这个思路应该这么做,或者说他好厉害,他怎么知道该这么设计实现. 说下难点吧,我觉得后天逻辑还好,主要是前端部分真的需要点花点时间来思考, ...

  8. 微软的文本转语音服务Microsoft.CognitiveServices.Speech

    微软的Edge 浏览器里的大声朗读里-"晓晓" 很接近自然人,比起其它平台的强很多. 在AZURE 可免费体验,每月限额50万字,每个语音转换不超过10分钟长度. C# 调用: u ...

  9. 高精度离线免费 的C#文字识别PaddleOCR库

    随便打开一个Microsoft Visual Studio,新建一个WinForms项目,从下面列表中随便选择一个NET框架.目标平台要设置成X64,该OCR仅支持64位. net35;net40;n ...

  10. AI实用技巧 | 5分钟将coze集成到微信群机器人

    细心的小伙伴已经注意到,国内的Coze平台已经开放了API,这一发现让他们感到兴奋不已.因此,他们迫切地想要掌握这一机会,将API应用到实际中,让Coze成为他们的得力助手.这样一来,他们就可以避免每 ...