skillfed

pytest-rerunfailures

pytest plugin to re-run tests to eliminate flaky failures

pytest-rerunfailures Copyleft license MPL-2.0 Active 470 v16.5 released

Install

pytest-rerunfailures on PyPI

pip

pip install pytest-rerunfailures

uv

uv add pytest-rerunfailures

poetry

poetry add pytest-rerunfailures

Package facts

License MPL-2.0 (copyleft)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — packaging, pytest
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: pytest_rerunfailures-16.5-py3-none-any.whl

Keywords: failures, flaky, pytest, rerun

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Quality AssuranceTopic :: Software Development :: TestingTopic :: Utilities

About pytest-rerunfailures

from the package's own PyPI description — quoted content, verbatim

.. contents::

pytest-rerunfailures

.. START-SHORT-DESCRIPTION

pytest-rerunfailures is a plugin for pytest <https://pytest.org>_ that re-runs tests to eliminate intermittent failures.

.. END-SHORT-DESCRIPTION

.. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg :target: https://github.com/pytest-dev/pytest-rerunfailures/blob/master/LICENSE :alt: License .. image:: https://img.shields.io/pypi/v/pytest-rerunfailures.svg :target: https://pypi.python.org/pypi/pytest-rerunfailures/ :alt: PyPI .. image:: https://github.com/pytest-dev/pytest-rerunfailures/workflows/Test/badge.svg :target: https://github.com/pytest-dev/pytest-rerunfailures/actions :alt: GitHub Actions .. image:: https://readthedocs.org/projects/pytest-rerunfailures/badge/?version=latest :target: https://pytest-rerunfailures.readthedocs.io/latest/?badge=latest :alt: Documentation Status

.. START-INSTALLATION

Requirements

You will need the following prerequisites in order to use pytest-rerunfailures:

  • Python 3.10+ or PyPy3
  • pytest 8.2 or newer

This plugin can recover from a hard crash with the following optional prerequisites:

-...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

A pytest plugin that automatically re-runs failed tests to eliminate intermittent flaky failures, with support for delays, backoff strategies, and selective exception filtering.

Low friction: pure Python wheel with only packaging and pytest as runtime dependencies. Actively maintained with a recent release (2026-08-13) and 470 GitHub stars. Requires Python 3.10+ and pytest 8.2+.

Licensed under MPL-2.0 (copyleft). Users must comply with copyleft obligations if they modify or distribute the package; commercial use of the package itself is permitted.

Usage

pip install pytest-rerunfailures

# Mark a test to rerun on failure
import pytest

@pytest.mark.flaky(reruns=5)
def test_example():
    assert True

# Or run all tests with reruns from command line
# pytest --reruns 5 --reruns-delay 1

Requires Python 3.10+ and pytest 8.2 or newer. Optional: pytest-xdist 2.3.0+ to recover from hard crashes.

Verdict: A well-maintained, production-stable pytest plugin for handling flaky tests with minimal dependencies and no known vulnerabilities. MPL-2.0 copyleft licensing is straightforward for most projects. Suitable for teams dealing with intermittent test failures.

Needs verification

  • Whether the optional pytest-xdist integration for hard-crash recovery is commonly needed in practice
  • Performance impact when rerunning large test suites with many failures
pytest flaky test rerunintermittent test failure handlingpytest retry failed testseliminate flaky tests pytesttest rerun with delaypytest test stability

Similar packages