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

回退后,执行正常

相关推荐
IT求学人5 小时前
pytest运行用例的常见方式及参数
pytest
开源优测1 天前
什么是pytest.ini及如何在Pytest中应用以提升配置效率
pytest
摸鱼仙人~2 天前
ImportError: cannot import name ‘FixtureDef‘ from ‘pytest‘
conda·pytest·fastapi
唐古乌梁海2 天前
【pytest-jira】自动化用例结合jira初版集成思路
pytest·jira
小码哥说测试3 天前
高效执行自动化用例:分布式执行工具pytest-xdist实战!
自动化测试·软件测试·功能测试·jmeter·pytest·postman·测试工程师
予早4 天前
pytest asyncio 支持插件 pytest-asyncio
pytest
爱学测试的雨果6 天前
Pytest自动化测试框架关联/参数化实战
前端·pytest
测试杂货铺6 天前
Pytest快速入门
自动化测试·软件测试·python·测试工具·职场和发展·测试用例·pytest