Skip to content

fix: prevent rerun when teardown error matches --rerun-except - #338

Merged
icemac merged 5 commits into
pytest-dev:masterfrom
pctablet505:fix-270-rerun-except-teardown
Aug 3, 2026
Merged

fix: prevent rerun when teardown error matches --rerun-except#338
icemac merged 5 commits into
pytest-dev:masterfrom
pctablet505:fix-270-rerun-except-teardown

Conversation

@pctablet505

Copy link
Copy Markdown
Contributor

Fixes #270

When --rerun-except is used and a teardown failure matches the excluded error, the test was still rerun because only the current report's stage was checked for terminal errors. Now all stages of the current execution are considered, so a terminal teardown error prevents reruns as expected.

@pctablet505
pctablet505 marked this pull request as ready for review July 17, 2026 12:47

@icemac icemac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thank you for the PR.

@icemac
icemac enabled auto-merge (squash) August 3, 2026 06:54
@icemac
icemac merged commit 0440e21 into pytest-dev:master Aug 3, 2026
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.

rerun-except option ignores teardown error

2 participants