Disable reruns with a warning instead of erroring under --pdb - #374
Merged
icemac merged 3 commits intoSep 22, 2026
Merged
Conversation
Combining --pdb with --reruns/--force-reruns/a flaky marker previously raised a UsageError. Someone reaching for the debugger almost never wants reruns, so warn and run each test once instead. Closes pytest-dev#248. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
@LouisDeconinck Thank you for working on so many open issues. Just to inform you: I have a limited review capacity of up to one PR per day. I will review all of them but probably slower than probably expected. — written by myself, no AI used |
icemac
reviewed
Sep 18, 2026
icemac
reviewed
Sep 18, 2026
icemac
reviewed
Sep 18, 2026
icemac
self-requested a review
September 18, 2026 07:01
Escalated PytestWarning instances (from -W error or filterwarnings = error) are caught and re-emitted under an "always" filter so the run continues with reruns disabled instead of aborting with an INTERNALERROR, and the warning is still recorded for the warnings summary. Also bump the issue_config_time_warning stacklevel to 3 so the warning points at check_options() rather than the helper's internals. Co-Authored-By: Louis Deconinck <louis.dck@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--pdbcombined with--reruns,--force-rerunsor theflakymarker now emits aPytestWarning("--reruns incompatible with --pdb: reruns are disabled") instead of raisingUsageErrorissue_config_time_warning; marker-requested reruns warn once viaitem.warnget_reruns_countreturns 0 under--pdb, so each test runs exactly onceCloses #248
Test plan
--pdbtests to assert warning + single execution (using a stub--pdbclsso no interactive session starts)