Skip to content

Add a --force-reruns to override rerun count globally#307

Merged
icemac merged 5 commits intopytest-dev:masterfrom
mgorny:force-reruns
Oct 8, 2025
Merged

Add a --force-reruns to override rerun count globally#307
icemac merged 5 commits intopytest-dev:masterfrom
mgorny:force-reruns

Conversation

@mgorny
Copy link
Copy Markdown
Contributor

@mgorny mgorny commented Sep 18, 2025

Add a new --force-reruns command-line option that can be used to override the rerun count globally, irrespectively of individual test markers.

Fixes #306.

Add a new `--force-reruns` command-line option that can be used to
override the rerun count globally, irrespectively of individual test
markers.

Fixes pytest-dev#306.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Sep 18, 2025

The test failure seems irrelevant to my changes. The specific case probably needs to be excluded, given that pytest main no longer supports Python 3.9.

@icemac
Copy link
Copy Markdown
Contributor

icemac commented Sep 18, 2025

@mgorny Thank you for the PR let me prepare a PR that fixed the test issue.

@icemac icemac requested a review from Copilot September 19, 2025 05:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new --force-reruns command-line option that allows users to override the rerun count globally, bypassing any individual test markers that specify rerun counts.

  • Adds the --force-reruns CLI option to force a specific number of reruns for all tests
  • Modifies the rerun logic to prioritize the global force setting over individual test markers
  • Includes comprehensive documentation and test coverage for the new feature

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/pytest_rerunfailures.py Adds CLI option and modifies rerun count logic to check force setting first
tests/test_pytest_rerunfailures.py Adds test case to verify force reruns behavior with and without markers
docs/cli.rst Documents the new --force-reruns option with usage examples
README.rst Adds user-facing documentation for the force rerun feature
CHANGES.rst Records the new feature in the changelog

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/pytest_rerunfailures.py Outdated
Comment thread docs/cli.rst Outdated
Comment thread README.rst Outdated
@icemac
Copy link
Copy Markdown
Contributor

icemac commented Oct 1, 2025

@mgorny The GHA failure is now fixed upstream. Could you please have a look into the Copilot comments?

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Oct 1, 2025

I'm not a native speaker, so I guess the statistical data set knows better.

@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Oct 1, 2025

Uh, looks like this time it's hitting a runner issue.

Copy link
Copy Markdown
Contributor

@icemac icemac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some suggestions.

Comment thread README.rst
Comment thread src/pytest_rerunfailures.py Outdated
mgorny and others added 2 commits October 2, 2025 18:47
Co-authored-by: Michael Howitz <m.howitz@minddistrict.com>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
@icemac icemac merged commit cb8ede7 into pytest-dev:master Oct 8, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please make it possible to override the rerun count globally

3 participants