def test_get_real_func() -> None:
    """Check that get_real_func correctly unwraps decorators until reaching the real function"""

    def decorator(f):
        @wraps(f)
        def inner():
            pass  # pragma: no cover

        return inner

    def func():
        pass  # pragma: no cover

    wrapped_func = decorator(decorator(func))
    assert get_real_func(wrapped_func) is func

    wrapped_func2 = decorator(decorator(wrapped_func))
    assert get_real_func(wrapped_func2) is func

    # obtain the function up until the point a function was wrapped by pytest itself
    @pytest.fixture
    def wrapped_func3():
        pass  # pragma: no cover

    wrapped_func4 = decorator(wrapped_func3)
    assert get_real_func(wrapped_func4) is wrapped_func3._get_wrapped_function()
Check that get_real_func correctly unwraps decorators until reaching the real function
testing/test_compat.py