您的位置:首页 > 娱乐 > 八卦 > allure_pytest:AttributeError: ‘str‘ object has no attribute ‘iter_parents‘

allure_pytest:AttributeError: ‘str‘ object has no attribute ‘iter_parents‘

2024/10/6 22:26:17 来源:https://blog.csdn.net/joker_zsl/article/details/140502921  浏览:    关键词: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 pytestpip install pytest==8.0.2

回退后,执行正常

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com