sknano.testing.GeneratorTestFixtures.assertRaisesRegex

GeneratorTestFixtures.assertRaisesRegex(expected_exception, expected_regex, callable_obj=None, *args, **kwargs)[source]

Asserts that the message in a raised exception matches a regex.

Args:

expected_exception: Exception class expected to be raised. expected_regex: Regex (re pattern object or string) expected

to be found in error message.

callable_obj: Function to be called. msg: Optional message used in case of failure. Can only be used

when assertRaisesRegex is used as a context manager.

args: Extra args. kwargs: Extra kwargs.