Isn't it better to just remove the message check on `assert_raise` rather than doing this? Otherwise we are just testing that this function is being called.