def get_real_func(obj):
    ' gets the real function object of the (possibly) wrapped object by\n    functools.wraps or functools.partial.\n    '
    start_obj = obj
    for i in range(100):
        new_obj = getattr(obj, '__pytest_wrapped__', None)
        if isinstance(new_obj, _PytestWrapper):
            obj = new_obj.obj
            break
        new_obj = getattr(obj, '__wrapped__', None)
        if (new_obj is None):
            break
        obj = new_obj
    else:
        raise ValueError('could not find real function of {start}\nstopped at {current}'.format(start=saferepr(start_obj), current=saferepr(obj)))
    if isinstance(obj, functools.partial):
        obj = obj.func
    return obj
gets the real function object of the (possibly) wrapped object by
functools.wraps or functools.partial.
def get_real_func(obj):
    ' gets the real function object of the (possibly) wrapped object by\n    functools.wraps or functools.partial.\n    '
    start_obj = obj
    for i in range(100):
        new_obj = getattr(obj, '__pytest_wrapped__', None)
        if isinstance(new_obj, _PytestWrapper):
            obj = new_obj.obj
            break
        new_obj = getattr(obj, '__wrapped__', None)
        if (new_obj is None):
            break
        obj = new_obj
    else:
        raise ValueError('could not find real function of {start}\nstopped at {current}'.format(start=saferepr(start_obj), current=saferepr(obj)))
    if isinstance(obj, functools.partial):
        obj = obj.func
    return obj