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

回退后,执行正常

相关推荐
思则变3 天前
[Pytest][Part 1]Pytest 自动化测试框架
pytest
思则变4 天前
[Pytest] [Part 2]增加 log功能
开发语言·python·pytest
思则变5 天前
[Pytest][Part 3]检测python package状态
pytest
cooldream200919 天前
pytest 框架详解与实战指南
pytest·测试
慕城南风19 天前
【pytest进阶】Pytest之conftest详解
pytest
编程小白gogogo19 天前
AI自动化测试速成(Pytest框架)
pytest
慕城南风20 天前
【pytest进阶】pytest详解及进阶使用
linux·服务器·pytest
Tom Boom1 个月前
Pytest断言全解析:掌握测试验证的核心艺术
自动化测试·python·测试开发·pytest
不要一直敲门1 个月前
初学 pytest 记录
pytest