RFC: provide warns with a behavior similar to raises #2708
Labels
plugin: warnings
related to the warnings builtin plugin
type: enhancement
new feature or API change, should be merged into features branch
When dealing with the messages thrown by warnings (IMHO) it would great if we could use the same calls as for the
raises
case. As example, this would allow for:I have implemented such behavior by wrapping
pytest.warns
here in the following manner:Do you think is a valuable feature? Do you think that a PR implementing such behavior is useful to anyone? I'm sure I'm not the first one to wander why
warns
has different signature thanraises
. Therefore I can only guess that is not that easy to integrate it to pytest. But If you think that PR is in order I'll be happy to do it.The text was updated successfully, but these errors were encountered: