def assert_raise_message(exception, message, function, *args, **kwargs):
    """Helper function to test error messages in exceptions"""

    try:
        function(*args, **kwargs)
        raise AssertionError(exception(message) % "Should have raised %r")
    except exception as e:
        error_message = str(e)
        assert_in(message, error_message)
dataset/ETHPy150Open trevorstephens/gplearn/gplearn/skutils/testing.py/assert_raise_message/swapped operands of `%`