Skip to content

Fix regression making --pdb unusable without configured reruns - #343

Merged
icemac merged 3 commits into
masterfrom
fix-342-pdb-regression
Aug 17, 2026
Merged

Fix regression making --pdb unusable without configured reruns#343
icemac merged 3 commits into
masterfrom
fix-342-pdb-regression

Conversation

@icemac

@icemac icemac commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #342.

Since 16.5, check_options() runs unconditionally in pytest_configure (#332), and its guard config.option.reruns != 0 is always true when --reruns is unset (None != 0). Now the check resolves the actually configured reruns (CLI, ini, --force-reruns), and marker-driven reruns are rejected per item as in 16.4.

The --pdb incompatibility check in check_options() treated an unset
--reruns option (None) as configured because of `None != 0`. This was
harmless while the check only ran once reruns were resolved per item,
but #332 moved it to pytest_configure, so it fired unconditionally.

Resolve the actually configured global reruns (CLI, ini, --force-reruns)
in check_options() and restore a per-item check for marker-driven
reruns.

Fixes #342.

@sallner sallner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I generally like the changes and they look sound. Tests were added that cover the mentioned problem.

Comment thread src/pytest_rerunfailures.py Outdated
@icemac
icemac enabled auto-merge (squash) August 17, 2026 07:04
@icemac
icemac merged commit 44cc385 into master Aug 17, 2026
84 checks passed
@icemac
icemac deleted the fix-342-pdb-regression branch August 17, 2026 07:07
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.

ERROR: --reruns incompatible with --pdb in version 16.5 even if not setting --reruns

2 participants