allure_pytest:AttributeError: ‘str‘ object has no attribute ‘iter_parents‘

踩坑记录

问题描述:

接口自动化测试时出现报错,报错文件是allure_pytest库

问题分析:

自动化测试框架是比较成熟的代码,报错也不是自己写的文件,而是第三方库,首先推测是allure_pytest和某些库有版本不兼容的问题

搜索发现,pytest 8.2.0 和 8.1.0 的几个版本会破坏 allure 的 listener 导致虚拟机上执行报错,需把pytest 回退到8.0.2

解决方案:

pip uninstall pytest

pip install pytest==8.0.2

回退后,执行正常

相关推荐
XXX-1716 小时前
1.pytest基础知识(默认的测试用例的规则以及基础应用)
软件测试·pytest
Mavis先生1 天前
PyTest装饰器
pytest
神即道 道法自然 如来4 天前
Python+Pytest框架,“main_run.py文件怎么编写“?
java·python·pytest
___Dream5 天前
【项目一】基于pytest的自动化测试框架———解读requests模块
python·计算机网络·pytest
ccy加油呀7 天前
pytest 接口测试
android·pytest
云泽野9 天前
一篇文章了解Pytest单元测试框架
服务器·单元测试·pytest
___Dream10 天前
【项目一】基于pytest的自动化测试框架day1
pytest
这不巧了10 天前
Faker在pytest中的应用
python·自动化·pytest
测试界的海飞丝11 天前
pytest运行方式及前置后置封装详解
开发语言·selenium·单元测试·pytest
什么时候才能变强11 天前
Pytest-@pytest.fixture夹具篇(一)
pytest