GeneratorTestFixtures.assertWarnsRegex(expected_warning, expected_regex, callable_obj=None, *args, **kwargs)[source]

Asserts that the message in a triggered warning matches a regexp. Basic functioning is similar to assertWarns() with the addition that only warnings whose messages also match the regular expression are considered successful matches.


expected_warning: Warning class expected to be triggered. 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 assertWarnsRegex is used as a context manager.

args: Extra args. kwargs: Extra kwargs.