if isinstance(obj, type):
    return True
if getattr(obj, '__call__', None) is not None:
    return True
if isinstance(obj, (staticmethod, classmethod)) and mock._callable(obj.__func__
    ):
    return True
return False
_patched_callable._old_func = mock._callable
mock._callable = _patched_callable
How to patch classmethod with autospec in unmocked class?