def fail(s):
    """
    A function that should fail out of the execution with a RuntimeError and the
    provided message.

    Args:
        s: The message to put into the error.

    Returns:
        A function object that throws an error when run.
    """
    def func():
        raise RuntimeError(s)

    return func