[issue43596] change assertRaises message when wrong exception is raised

Irit Katriel report at bugs.python.org
Sun Aug 1 05:11:14 EDT 2021


Irit Katriel <iritkatriel at gmail.com> added the comment:

Another way to look at it is that your test has two problems. One is that the expected exception didn’t happen and the other is that an unexpected exception happened. 

The two problems are usually unrelated, and trying to conflate them into one error message can be confusing in some cases. When a test has multiple problems you get an error for the first one.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43596>
_______________________________________


More information about the Python-bugs-list mailing list