pytest执行_allure报“AttributeError: module 'allure' has no attribute 'severity_level'”
背景:
一个大项目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'”的更多相关文章
- 如果生成allure报告过程中报错AttributeError: module 'allure' has no attribute 'severity_level'
1.pip uninstall pytest-allure-adaptor 2.pip install allure-pytest 3.搞定 快去吃饭吧
- 报错问题: AtrributeError:module ‘allure’ has no attribute ‘’severity_level’
问题:执行命令报错:pytest -s -q --alluredir report 报错问题: AtrributeError:module 'allure' has no attribute ''se ...
- Python报AttributeError: module 'string' has no attribute 'join'解决方法
报:AttributeError: module 'string' has no attribute 'join' 属性错误:模块"string"没有属性"join&qu ...
- 运行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 ...
- 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 ...
- AttributeError: module 'datetime' has no attribute 'now'
在用时间转化时,一直报AttributeError: module 'datetime' has no attribute 'now', 我用的 import datetime datetime ...
- [转载]pytest报AttributeError: module ‘pytest‘ has no attribute ‘main‘
转自:https://blog.csdn.net/yinying12/article/details/110522989 pytest报AttributeError: module 'pytest' ...
- python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?
python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...
- 安装pandas报错(AttributeError: 'module' object has no attribute 'main')
在pycharm中安装pandas出现报错:AttributeError: 'module' object has no attribute 'main', 刚开始以为是pip的版本太旧了,于是乎将其 ...
- 在运行create_list.sh时候报错:AttributeError: 'module' object has no attribute 'LabelMap'
Traceback (most recent call last):File "/opt/xuben-project/caffe/data/VOC0712/../../scripts/cre ...
随机推荐
- [PHP] Laravel 联查中对不同表字段关系加条件的方式
如果条件需要加在 where 条件里,使用 whereColumn,如下示例: whereColumn('A.b_id', '=', 'B.id'); 如果需要加载 join 的 on 之后作为多个条 ...
- 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 ...
- vue-单独引入css文件,设置公共的css样式或者修改默认的vant,mint样式
1.css文件夹下新建global.css文件并粘贴复制: ======================= :root{ --bgColor : #d3252a; --pinkColo ...
- 【Android】Binder的Oneway拦截
在某些虚拟化,免安装,打点,环境检测,拦截器等场景,针对Android系统服务接口的拦截是常用的技术方案.通常只是针对正向的接口调用,如果涉及被动的服务回调拦截,则实现起来就有些许麻烦. 说明 由于我 ...
- Gparted扩展硬盘空间
需求:有一些磁盘占满了空间,例如/亦或者/opt目录等.可以通过Gparted扩展空间. 1.vmware添加ISO [添加光盘]gparted-live-cd添加至ISO 2.延迟引导启动,强制进入 ...
- 洛谷P3543 [POI2012] WYR-Leveling Ground
题目描述 给定 \(n\) 个数和 \(a,b\) 每次可以选择一段区间 \(+a,-a,+b ,或 -b\),问最少操作几次能把它们都变成 \(0\).如果无解请输出 \(-1\). 样例输入 5 ...
- v-for比v-if优先级更高
在V2当中,v-for的优先级更高,而在V3当中,则是v-if的优先级更高. 在V3当中,做了v-if的提升优化,去除了没有必要的计算, 但同时也会带来一个无法取到v-for当中遍历的item问题, ...
- 前端使用 Konva 实现可视化设计器(10)- 对齐线
请大家动动小手,给我一个免费的 Star 吧~ 大家如果发现了 Bug,欢迎来提 Issue 哟~ github源码 gitee源码 示例地址 不知不觉来到第 10 章了,感觉接近尾声了... 对齐线 ...
- C#TMS系统学习(BaseCity页面)
C#TMS系统代码-基础页面BaseCity学习 本人纯新手,刚进公司跟领导报道,我说我是java全栈,他问我会不会C#,我说大学学过,他说这个TMS系统就给你来管了.外包已经把代码给我了,这几天先把 ...
- C数据结构:KMP算法详解(呕心沥血)
KMP算法 作者心声 了解暴力求解(必需会) KMP算法详解 记住我这段话(你会爱上它的)← : ①前后缀及其用处 ②求出前后缀的next数组 求出next数组的代码 开始实现KMP算法 结尾 附上源 ...