Hi Tim,

> Without testing for a message, there's also a possibility that the
> exception you think you're testing isn't the one the test is actually
> raising. 

If you need to verify the error message for that reason, then the exception is 
probably not specific enough. Testing the message, in this case, is just 
working around faulty design.

> I think the readability advantages of including messages in the
> tests outweigh the cost of updating tests when a message changes.

In some cases, of course; but I see a significant distance between that and a 
general recommendation to prefer assertRaisesMessage.

Shai.

Reply via email to