I have my Python unit test code that looks like the following
self.assertRaises(exc.UserError, module.function, args)
This basically asserts that a UserError was raised. I however cannot find how to check if the message in the exception matches my regular expression.
How can I do this? (I would prefer not to write any extra code and just leverage python unittest module features)