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

回退后,执行正常

相关推荐
程序员杰哥1 天前
Pytest与Unittest测试框架对比
自动化测试·软件测试·python·测试工具·测试用例·excel·pytest
软件测试小仙女1 天前
Pytest参数化实战:高效测试API接口
软件测试·测试开发·测试工具·pytest·接口测试·api·参数化
子正1 天前
Pytest单元测试一例:u16采样值格式转换的错误
单元测试·pytest
cllsse2 天前
pytest学习
软件测试·python·pytest
Test.X3 天前
学习16天:pytest学习
学习·pytest
唐古乌梁海4 天前
【pytest 】 pytest 生命周期
pytest
专职5 天前
pytest详细教程
开发语言·python·pytest
乄捷径5 天前
pytest入门到熟练
pytest
专职5 天前
pytest+requests+allure生成接口自动化测试报告
开发语言·python·pytest
小熊出擊6 天前
【pytest】fixture 内省(Introspection)测试上下文
python·单元测试·pytest