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
爆更小哇4 天前
pytest集成Allure报告教程
python·测试工具·pytest·接口测试·allure
gCode Teacher 格码致知4 天前
Python提高:pytest的简单案例-由Deepseek产生
python·pytest
gCode Teacher 格码致知5 天前
Python提高: unittest和 pytest的使用方法-由Deepseek产生
开发语言·python·pytest
我的xiaodoujiao8 天前
API 接口自动化测试详细图文教程学习系列11--Requests模块3--测试练习
开发语言·python·学习·测试工具·pytest
我的xiaodoujiao9 天前
API 接口自动化测试详细图文教程学习系列12--Requests模块4--测试实践操作
python·学习·测试工具·pytest
Lightning-py10 天前
pytest 软断言的几种方式
pytest
Lightning-py11 天前
pytest后置处理方式
pytest
爆更小哇12 天前
Python自动化测试:pytest新手快速入门指南
python·测试工具·自动化·pytest
qq_4523962312 天前
第一篇:基座选型 —— 为什么 Pytest 是自动化的终点?
自动化·pytest