MCPcopy Index your code
hub / github.com/python/cpython / _extract_mock

Function _extract_mock

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

Source from the content-addressed store, hash-verified

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

Callers 3

_check_and_set_parentFunction · 0.85
attach_mockMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…