def function_mock(request, q_function_name, **kwargs):
    _patch = patch(q_function_name, **kwargs)
    request.addfinalizer(_patch.stop)
    return _patch.start()
Return a mock patching the function with qualified name
dataset/ETHPy150Open python-openxml/python-docx/tests/unitutil/mock.py/function_mock