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

回退后,执行正常

相关推荐
我的xiaodoujiao4 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 28--开源电商商城系统项目实战--封装注册页面
python·学习·测试工具·pytest
Mr_Xuhhh17 小时前
pytest -- fixture
开发语言·python·pytest
Mr_Xuhhh1 天前
pytest -- 指定⽤例执⾏顺序
开发语言·python·pytest
Mr_Xuhhh1 天前
pytest -- ⽇志与测试报告
pytest
西游音月3 天前
(5)pytest+Selenium自动化测试-元素定位之XPath定位
selenium·测试工具·pytest
西游音月5 天前
(4)pytest+Selenium自动化测试-元素定位之CSS Selector定位
css·selenium·pytest
淼_@淼6 天前
pytest-数据驱动
pytest
我的xiaodoujiao7 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 27--二次封装方法--优化断言结果
python·学习·测试工具·pytest
淼_@淼9 天前
pytest简介
运维·服务器·pytest
奶茶精Gaaa10 天前
【ZJ】Pytest框架搭建
pytest