tests/_util.py
def always_throw(exception_type):
    """Factory to create methods that throw exceptions.

    Args:
        exception_type: The type of exception to throw

    Returns:
        function: A function that always throws an exception when called.

    """
    # noinspection PyUnusedLocal
    def wrapped(*args, **kwargs):
        raise exception_type
    return wrapped
Factory to create methods that throw exceptions.

    Args:
        exception_type: The type of exception to throw

    Returns:
        function: A function that always throws an exception when called.

    
Factory to create methods that throw exceptions.
Factory to create methods that throw exceptions .
def always_throw(exception_type):
    def wrapped(*args, **kwargs):
        raise exception_type
    return wrapped
def always_throw ( exception_type ) : def wrapped ( * args , ** kwargs ) : raise exception_type return wrapped
Factory to create methods that throw exceptions.
Factory to create methods that throw exceptions .
"""Factory to create methods that throw exceptions.

    Args:
        exception_type: The type of exception to throw

    Returns:
        function: A function that always throws an exception when called.

    """ # noinspection PyUnusedLocal
A function that always throws an exception when called.
A function that always throws an exception when called .
function
exception_type
The type of exception to throw
The type of exception to throw