背景:

一个大项目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. [Blockchain] Cosmos Starport 101 - 为你的新数据类型 生成代码

    # 项目模板 $ starport app github.com/hello/planet --address-prefix your_new_prefix 项目目录结构的说明看这里: https:/ ...

  2. [FE] WebStorm, ESLint: Trailing spaces not allowed

    在 WebStorm 中搜索文件 .eslintrc.js 在里面的 rules 项中追加规则: 'no-trailing-spaces' : ['off', { 'skipBlankLines': ...

  3. dotnet win32 使用 WIC 获取系统编解码器

    在 Windows 系统上,有一个很重要的概念是 Windows Imaging Component 也就是 WIC 层,这是专门用来处理多媒体相关的系统组件,特别是用来处理图片相关,包括编码和解码和 ...

  4. 2019-3-15-uwp-ScrollViewer-content-out-of-panel-when-set-the-long-width

    title author date CreateTime categories uwp ScrollViewer content out of panel when set the long widt ...

  5. 17.prometheus服务发现&基于文件的服务发现

    一.服务发现 Prometheus 中是如何使用服务发现来查找和抓取目标的.我们知道在 Prometheus 配置文件中可以通过一个 static_configs 来配置静态的抓取任务,但是在云环境下 ...

  6. Django之ORM操作Mysql

    一.单表操作 # 单表查询操作基本方法 class BookList(models.Model): title = models.CharField(max_length=32) price = mo ...

  7. Unsortbin attack原理及分析

    Unsortbin attack原理 ️条件:首先要实现Unsortbin attack前提是可以控制Unsortbin attack chunk的bk指针 ️目的:我们可以实现修改任意地址为一个比较 ...

  8. DE10-Lite输入/出高/低电平说明

    DE10-Lite输入/出高/低电平说明 DE10-Lite实验板上有一些设备可以输入/出高/低电平,说明如下: HEX 7-segment LED displays (active low)共阳极 ...

  9. 一个在线下载地图XYZ瓦片的网站实现

    1. 什么是XYZ瓦片 XYZ瓦片是一种在线地图数据格式,常见的地图底图如Google.OpenStreetMap 等互联网的瓦片地图服务,都是XYZ瓦片,严格来说是ZXY规范的地图瓦片 ZXY规范的 ...

  10. rails 给数据库表里加入索引

    创建迁移文件 rails g migration add_product_images_index 编写迁移文件 db/migrate/20170119093958_add_product_image ...