CheckOps home

Tools directory

P

CheckOps

pytest-rerunfailures

pytest-rerunfailures is an MPL-2.0 pytest plugin from pytest-dev that re-runs failed tests up to a set number of times to reduce flaky failures.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

pytest-rerunfailures is a pytest plugin that re-runs tests that fail, up to N times, to eliminate flaky failures from the build result.

Use --reruns 2 globally or mark specific tests with @pytest.mark.flaky(reruns=3, reruns_delay=1). Options restrict reruns to particular exception types and add delays between attempts. Rerun tests are reported as ‘rerun’ so you can see how often flakiness occurs.

In the quality loop it is a stop-gap for flakiness while root causes are fixed.

The source code is at pytest-dev/pytest-rerunfailures on GitHub under the MPL-2.0 licence, with about 483 stars; the most recent commit was on 7 October 2026.

Features

  1. Global reruns: --reruns for every test.
  2. Per-test marker: @pytest.mark.flaky.
  3. Delays: Wait between attempts.
  4. Exception filters: Rerun only on chosen errors.
  5. Rerun reporting: Reruns appear in results.
  6. pytest-dev project: Maintained under pytest-dev.

Pros

  1. Immediate relief: Stops flaky tests from blocking merges.
  2. Free to use: Open source under the MPL-2.0 licence, so the core tool costs nothing to use.
  3. Actively maintained: The repository had commits as recent as 7 October 2026.

Cons

  1. Masks real issues: Reruns can hide genuine intermittent bugs.
  2. Longer runs: Failures cost extra time.
  3. Compatibility: Some plugins interact poorly with reruns.
pip install pytest-rerunfailures
pytest --reruns 2 --reruns-delay 1 --only-rerun ConnectionError

Resources:

Pricing

pytest-rerunfailures is free and open source under the MPL-2.0 licence.

  1. Python teams dealing with intermittent network or timing failures.
  2. CI pipelines that track rerun counts as a flakiness metric.

Conclusion

pytest-rerunfailures is a pragmatic tool for living with flaky tests.

Pair it with a flaky-test tracker so reruns lead to fixes.

On CheckOps, pytest-rerunfailures is filed under the Release & CI gates stage. Related tools listed here include pytest, pytest-xdist, Gradle Test Retry Plugin, Trunk Flaky Tests, BuildPulse and Currents. A short trial on a real project, with your own code, data and pipeline, is usually the fastest way to choose between them, because fit matters more than feature lists. Facts here come from the official site, documentation and repository, checked on 11 November 2026.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with pytest-rerunfailures side by side.