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

Function _is_instance_mock

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

Source from the content-addressed store, hash-verified

70
71
72def _is_instance_mock(obj):
73 # can't use isinstance on Mock objects because they override __class__
74 # The base class for all mocks is NonCallableMock
75 return issubclass(type(obj), NonCallableMock)
76
77
78def _is_exception(obj):

Callers 9

_is_async_objFunction · 0.85
reset_mockFunction · 0.85
_check_and_set_parentFunction · 0.85
_mock_add_specMethod · 0.85
reset_mockMethod · 0.85
__setattr__Method · 0.85
__init__Method · 0.85
__enter__Method · 0.85
create_autospecFunction · 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…