Skip to content

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
@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