Lines Matching defs:Mock
8 'Mock',
69 # can't use isinstance on Mock objects because they override __class__
263 # Mock is not configured yet so the attributes are set
410 """A non-callable version of `Mock`"""
508 raise InvalidSpecError(f'Cannot spec a Mock object. [object={spec!r}]')
653 raise AttributeError("Mock object has no attribute %r" % name)
769 raise AttributeError("Mock object has no attribute '%s'" % name)
775 raise AttributeError("Mock object has no attribute '%s'" % name)
1018 Subclasses of Mock may want to override this to customize the way
1047 klass = Mock
1204 class Mock(CallableMixin, NonCallableMock):
1206 Create a new `Mock` object. `Mock` takes several optional arguments
1207 that specify the behaviour of the Mock object:
1223 * `side_effect`: A function to be called whenever the Mock is called. See
1234 this is a new Mock (created on first access). See the
1243 calling the Mock will pass the call through to the wrapped object
1245 Mock object that wraps the corresponding attribute of the wrapped object
1543 # XXXX If new is a Mock we could call new.configure_mock(**kwargs)
1798 with patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()):
2152 class MagicMock(MagicMixin, Mock):
2154 MagicMock is a subclass of Mock with default implementations
2379 See :func:`.Mock.reset_mock()`
2387 class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock):
2389 Enhance :class:`Mock` with features allowing to mock
2422 case, the :class:`Mock` object behavior is the same as with an
2423 :class:`.Mock` object: the wrapped object may have methods
2682 raise InvalidSpecError(f'Cannot autospec a Mock object. '
2933 class PropertyMock(Mock):
2954 Given an input Mock, seals it to ensure no further mocks will be generated