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

回退后,执行正常

相关推荐
春日见2 天前
TEST文件夹:Pytest,集成测试,单元测试
服务器·人工智能·驱动开发·单元测试·计算机外设·集成测试·pytest
TRACER~852 天前
项目实战:pandas+pytest+allure+adb
adb·pandas·pytest
Franciz小测测3 天前
Pytest 并发分组执行引擎(支持UI / 接口自动化测试):从设计到工程落地
pytest
小猪咪piggy3 天前
【接口自动化】(2) pytest 测试框架
运维·自动化·pytest
忘忧记3 天前
Pytest + Requests + YAML 数据驱动+日志模块
网络·python·pytest
清水白石0084 天前
pytest Fixture 设计实战指南:作用域、依赖链、自动清理与测试资源高效复用
python·pytest
亚马逊云开发者5 天前
Amazon Nova Act 浏览器自动化测试实战:AI 驱动的端到端测试 + pytest 集成 + OpenClaw 场景落地
人工智能·pytest
cendy-LL6 天前
自动化测试之Pytest框架
pytest
我的xiaodoujiao7 天前
API 接口自动化测试详细图文教程学习系列7--相关Python基础知识6
python·学习·测试工具·pytest
忘忧记7 天前
pytest + YAML + requests`简单实例化
网络·pytest