MCPcopy Index your code
hub / github.com/RustPython/RustPython / _extract_mock

Function _extract_mock

Lib/unittest/mock.py:84–90  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

82
83
84def _extract_mock(obj):
85 # Autospecced functions will return a FunctionType with "mock" attribute
86 # which is the actual mock object that needs to be used.
87 if isinstance(obj, FunctionTypes) and hasattr(obj, 'mock'):
88 return obj.mock
89 else:
90 return obj
91
92
93def _get_signature_object(func, as_instance, eat_self):

Callers 3

_check_and_set_parentFunction · 0.85
attach_mockMethod · 0.85

Calls 2

isinstanceFunction · 0.85
hasattrFunction · 0.85

Tested by

no test coverage detected