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

回退后,执行正常

相关推荐
我的xiaodoujiao9 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 36--二次封装MySQL数据库连接操作
python·学习·测试工具·pytest
兴趣使然黄小黄3 天前
【Pytest】使用Allure生成企业级测试报告
python·pytest
少云清4 天前
【接口测试】4_代码实现 _pytest框架
pytest·接口测试
屋顶那猫4 天前
使用pyinstaller打包pytest项目
python·pytest
zyx没烦恼5 天前
pytest框架
pytest
兴趣使然黄小黄7 天前
【Pytest】Pytest常用的第三方插件
python·pytest
我的xiaodoujiao7 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 34--基础知识 9--文件上传功能
前端·python·测试工具·ui·pytest
我一定会有钱7 天前
pytest测试框架基础
python·单元测试·自动化·pytest
我的xiaodoujiao7 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 35--二次封装MySQL数据库连接操作
python·学习·测试工具·pytest
给你一页白纸8 天前
Pytest 测试用例自动生成:接口自动化进阶实践
python·pytest·接口自动化