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 ...
随机推荐
- [FAQ] MetaMask ALERT: 交易出错. 合约代码执行异常.
首先确认载入的合约地址是否是最新的,比如 web3 载入的 abi 格式的 json 文件名 正不正确. 其次需要检查合约逻辑是否都正确,以及是否是合约抛出的错误,这两点最好是通过写测试用例来保证. ...
- WPF dotnet 6 开启 PM v2 的 DPI 感知 导致触摸线程访问 UI 属性抛异常
本文记录一个 WPF 在 dotnet 6 的一个已知问题,且此问题我已修复提交给官方仓库.这是一个只有在 dotnet 6 框架下,非 dotnet 5 也非 .NET Core 3.1 也非 .N ...
- CMDB开发(二)
一.项目架构:目录规范 # 遵循软件开发架构目录规范 bin 启动文件 src 源文件(核心代码) config 配置文件 lib 公共方法 tests 测试文件 二.采集规范 # bin目录下新建s ...
- 路由跳转报错:Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated",...
记录一个路由跳转的报错: 将换成
- 一键自动化博客发布工具,用过的人都说好(oschina篇)
oschina和segmentfault一样,界面非常的清爽. 界面上除了必须的标题,内容之外,还有文章专辑和推广专区这几个选项. 一起来看看在blog-auto-publishing-tools中, ...
- gin框架获取参数
目录 httpext包 获取header头里的参数: scene := httpext.GetHeaderByName(ctx, "scene") // online / dev ...
- sql 查找是否存在的记录
场景:根据条件从数据库表中查询 『有』与『没有』,只有两种状态 方法1: SELECT count(*) FROM table WHERE a = 1 方法2: SELECT 1 FROM table ...
- 添加身份认证和鉴权方案-使用jwtbearer
HTTP身份认证框架 RFC 7235 定义了一个 HTTP 身份验证框架,服务器可以用来质询(challenge)客户端的请求,客户端则可以提供身份验证凭据. 服务端开启了身份认证后.如果客户端访问 ...
- .NET集成DeveloperSharp实现http网络请求&与其它工具的比较
爆了,爆了,DeveloperSharp系列近期又被制造业ERP.民航飞行App.建筑BIM.电力掌上营业厅.等多家大型采用,站在巨人的肩膀上你能走的更远. 支持.Net Core2.0及以上,支持. ...
- 微软在Microsoft Build 2024 上 发布了.NET 9 预览版4
在 Microsoft Build 2024 上,与往年一样,.NET 不是会议主题演讲的主题,但是微软在这个大会上为.NET 推出一组新的功能和工具,旨在使 .NET 开发更快.更轻松,具体内容可以 ...