让 Pytest 重试在 Allure 报告中“看得见、讲得清、用得上” 🔥

14 阅读1分钟

在 UI 自动化测试中,测试用例开启 reruns 后,失败往往变得难以理解。Allure 报告只显示最终结果,却隐藏了每一次尝试之间发生了什么。

我开发了一个 Pytest 插件 pytest-attempt-summary,可以将每次重试结果以 Attempt Summary 的形式展示在 Allure 报告中,让你:

  • 🔁 查看每次尝试的状态、耗时、错误
  • 🧠 快速识别 flaky 测试
  • 📸 查看截图,🎥 视频和 🧭 Trace 指引

开箱即用,完美兼容 pytest-rerunfailures + Playwright + Allure


安装

pip install pytest-attempt-summary

更多信息 & 源码