DEV Community

Discussion on: Asserting Exceptions with Pytest

Collapse
 
abadger profile image
Toshio Kuratomi

I just wanted to correct a common mistake in this comment since it was one of the first results from my google search. message is actually used for setting the message that pytest.rasies will display on failure. It's not about a comparison to the exception's message. match should always be used for that purpose. docs.pytest.org/en/latest/referenc...

(This problem catches almost everyone at one point or another. Which is the reason that pytest has chosen to deprecate the message parameter ;-)

Collapse
 
rhymes profile image
rhymes

thank you Toshio! I'll update the comment!

What did you search on Google to get here?