def METHOD_NAME(request, q_function_name, autospec=True, **kwargs):
    """Return mock patching function with qualified name *q_function_name*.
    Patch is reversed after calling test returns.
    """
    _patch = patch(q_function_name, autospec=autospec, **kwargs)
    request.addfinalizer(_patch.stop)
    return _patch.start()