# Automatically rerun flaky pytest cases with bounded retry rules before intermittent failures block merges with pytest-re

> Add controlled retries to pytest runs so agents can contain flaky tests and report final failures without rerunning whole suites by hand.

- Skill: `agentskillexchange/automatically-rerun-flaky-pytest-cases-with-bounded-retry-ru` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/automatically-rerun-flaky-pytest-cases-with-bounded-retry-ru`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/automatically-rerun-flaky-pytest-cases-with-bounded-retry-ru/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/automatically-rerun-flaky-pytest-cases-with-bounded-retry-ru

---


# Automatically rerun flaky pytest cases with bounded retry rules before intermittent failures block merges with pytest-rerunfailures

Add controlled retries to pytest runs so agents can contain flaky tests and report final failures without rerunning whole suites by hand.

## Prerequisites

Python, pytest, and the pytest-rerunfailures plugin

## Installation

Use the upstream install or setup path that matches your environment:
- $ pip install pytest-rerunfailures

Requirements and caveats from upstream:
- :target: https://pypi.python.org/pypi/pytest-rerunfailures/
- You will need the following prerequisites in order to use pytest-rerunfailures:
- Python 3.10+ or PyPy3

Basic usage or getting-started notes:
- ------------
- pytest 8.1 or newer
- This plugin can recover from a hard crash with the following optional

- Source: https://github.com/pytest-dev/pytest-rerunfailures
- Extracted from upstream docs: https://raw.githubusercontent.com/pytest-dev/pytest-rerunfailures/HEAD/README.rst

## Documentation

- https://pytest-rerunfailures.readthedocs.io/stable/

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/automatically-rerun-flaky-pytest-cases-with-bounded-retry-rules-before-intermittent-failures-block-merges-with-pytest-rerunfailures/)

