def wrap_deprecated(func, name):
    """Return a check function for a deprecated assert method call.

    If the `assertive-deprecated` option has been enabled and the wrapped
    check function doesn't yield any errors of its own, this function will
    yield an A503 error that includes the new name of the deprecated method.
    """
    def wrapper(self, node):
        for error in func(self, node):
            yield error
        else:
            yield self.error(node, 'A503', func=name, name=node.func.attr)
    return wrapper