Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recwarn: let base exceptions propagate through pytest.warns again #11920

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

bluetech
Copy link
Member

@bluetech bluetech commented Feb 4, 2024

Fix #11907.

@bluetech bluetech added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Feb 4, 2024
Comment on lines +306 to +309
# BaseExceptions like pytest.{skip,fail,xfail,exit} or Ctrl-C within
# pytest.warns should *not* trigger "DID NOT WARN" and get suppressed
# when the warning doesn't happen. Control-flow exceptions should always
# propagate.
Copy link
Contributor

Choose a reason for hiding this comment

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

Well, technically I see some packages (trio) using with pytest.raises(GeneratorExit) but it's a corner case, so I'm not going to argue.

@bluetech bluetech merged commit 718cd40 into pytest-dev:main Feb 16, 2024
24 checks passed
@bluetech bluetech deleted the warn-skip branch February 16, 2024 10:22
@bluetech bluetech added backport 8.0.x and removed needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch labels Feb 16, 2024
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.

pytest.warns() asserts when pytest.skip() is called
3 participants