def mock_responses(resps):
    """Decorator factory to make tests more DRY. Bundles responses.activate
    with a collection of response rules.

    :param list resps: List of response-formatted ArgCatcher arguments.

    """
    def wrapper(func):
        @responses.activate
        @functools.wraps(func)
        def wrapped(*args, **kwargs):
            for resp in resps:
                responses.add(*resp.args, **resp.kwargs)
            return func(*args, **kwargs)
        return wrapped
    return wrapper
Decorator factory to make tests more DRY. Bundles responses.activate
    with a collection of response rules.

    :param list resps: List of response-formatted ArgCatcher arguments.

    
tests/utils.py