• Home
  • Raw
  • Download

Lines Matching refs:spec_set

204 .. class:: Mock(spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec_set=…
219 * *spec_set*: A stricter variant of *spec*. If used, attempting to *set*
221 *spec_set* will raise an :exc:`AttributeError`.
398 .. method:: mock_add_spec(spec, spec_set=False)
404 If *spec_set* is true then only attributes on the spec can be set.
716 .. class:: NonCallableMock(spec=None, wraps=None, name=None, spec_set=None, **kwargs)
723 :attr:`spec_set` are able to pass :func:`isinstance` tests:
728 >>> mock = Mock(spec_set=SomeClass())
761 A callable mock which was created with a *spec* (or a *spec_set*) will
1058 .. function:: patch(target, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new…
1077 The *spec* and *spec_set* keyword arguments are passed to the :class:`MagicMock`
1080 In addition you can pass ``spec=True`` or ``spec_set=True``, which causes
1081 patch to pass in the object being mocked as the spec/spec_set object.
1164 If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, then the
1253 .. function:: patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, …
1259 manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* and
1372 .. function:: patch.multiple(target, spec=None, create=False, spec_set=None, autospec=None, new_cal…
1387 manager. The arguments *spec*, *spec_set*, *create*, *autospec* and
1738 If you use the *spec* or *spec_set* arguments then *only* magic methods
1992 .. function:: create_autospec(spec, spec_set=False, instance=False, **kwargs)
2001 If *spec_set* is ``True`` then attempting to set attributes that don't exist
2348 >>> with patch('__main__.Something', autospec=True, spec_set=True):