def assert_raises_and_contains(expected_exception_class, strings, callable_obj, *args, **kwargs):
    """Assert an exception is raised by passing in a callable and its
    arguments and that the string representation of the exception
    contains the case-insensitive list of passed in strings.

    Args
        strings -- can be a string or an iterable of strings
    """
    try:
        callable_obj(*args, **kwargs)
    except expected_exception_class as e:
        message = str(e).lower()
        try:
            is_string = isinstance(strings, basestring)
        except NameError:
            is_string = isinstance(strings, str)
        if is_string:
            strings = [strings]
        for string in strings:
            assert_in(string.lower(), message)
    else:
        assert_not_reached("No exception was raised (expected %s)" % expected_exception_class)
dataset/ETHPy150Open Yelp/Testify/testify/assertions.py/assert_raises_and_contains/original