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

回退后,执行正常

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-18 08:46:01       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-18 08:46:01       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-18 08:46:01       57 阅读
  4. Python语言-面向对象

    2024-07-18 08:46:01       68 阅读

热门阅读

  1. vue3中的watch函数

    2024-07-18 08:46:01       22 阅读
  2. 力扣题解(目标和)

    2024-07-18 08:46:01       22 阅读
  3. oracle数据字典详解

    2024-07-18 08:46:01       17 阅读
  4. 自定义异常

    2024-07-18 08:46:01       20 阅读
  5. leetcode-46. 全排列

    2024-07-18 08:46:01       23 阅读