Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

pytest-dev/pytest-rerunfailures helps add AI capability without starting from a blank model stack

说明与用途

**项目简介**

pytest-rerunfailures 是一个 pytest 插件,用于重跑失败的测试,最大限度地减少测试的不稳定性。

**价值**

该项目的价值在于,它能够帮助开发者在测试过程中减少不稳定性,通过重跑失败的测试,提高测试的可靠性和准确性。对于需要构建可靠的测试环境的项目,pytest-rerunfailures 是一个很好的选择。

**典型接入方式**

为了接入 pytest-rerunfailures,需要在 pytest 的配置文件中添加以下设置:

[pytest]
rerunfailures = 3  # 重跑失败的测试次数

还需要在测试文件中使用 pytest.mark.reruns 装饰器来指定重跑的次数和间隔。

import pytest

@pytest.mark.reruns(3, delay=1)  # 重跑 3 次,间隔 1 秒
def test_example():
    # 测试代码
    pass

**生产可用性**

pytest-rerunfailures 的生产可用性为中等。虽然它是一个稳定的

问题

pytest-dev/pytest-rerunfailures helps add AI capability without starting from a blank model stack.

结果

Medium: useful for prototypes or internal workflows, with dependency and maintenance checks before production.

工作流

  • prototype AI features
  • build RAG or agent workflows
  • evaluate model tooling

证据

a pytest plugin that re-runs failed tests up to -n times to eliminate flakey failures

来源

  • 记录日期: 2026-09-19T17:15:27.487Z