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

回退后,执行正常

相关推荐
测试开发Kevin1 天前
从投入产出、效率、上手难易度等角度综合对比 pytest 和 unittest 框架
python·pytest
测试开发Kevin4 天前
以pytest_addoption 为例,讲解pytest框架中钩子函数的应用
python·pytest
川石教育9 天前
Pytest中的fixture装饰器详解
python自动化测试·pytest·pytest自动化测试框架·pytest测试框架·pytest单元测试框架
春风又。9 天前
接口自动化——参数化
python·测试工具·自动化·pytest
XTY0012 天前
mac电脑pytest生成测试报告
pytest
程序员的世界你不懂12 天前
pytest-前后置及fixture运用
pytest
天才测试猿13 天前
基于Pytest接口自动化的requests模块项目实战以及接口关联方法详解
自动化测试·软件测试·python·测试工具·单元测试·测试用例·pytest
HtwHUAT14 天前
五、UI自动化测试05--PyTest框架
经验分享·python·ui·pytest
程序员的世界你不懂15 天前
Pytest-mark使用详解(跳过、标记、参数 化)
pytest
fish_study_csdn16 天前
pytest 技术总结
开发语言·python·pytest