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

Method __init__

Lib/unittest/mock.py:464–506  ·  view source on GitHub ↗
(
            self, spec=None, wraps=None, name=None, spec_set=None,
            parent=None, _spec_state=None, _new_name='', _new_parent=None,
            _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
        )

Source from the content-addressed store, hash-verified

462
463
464 def __init__(
465 self, spec=None, wraps=None, name=None, spec_set=None,
466 parent=None, _spec_state=None, _new_name='', _new_parent=None,
467 _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
468 ):
469 if _new_parent is None:
470 _new_parent = parent
471
472 __dict__ = self.__dict__
473 __dict__['_mock_parent'] = parent
474 __dict__['_mock_name'] = name
475 __dict__['_mock_new_name'] = _new_name
476 __dict__['_mock_new_parent'] = _new_parent
477 __dict__['_mock_sealed'] = False
478
479 if spec_set is not None:
480 spec = spec_set
481 spec_set = True
482 if _eat_self is None:
483 _eat_self = parent is not None
484
485 self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
486
487 __dict__['_mock_children'] = {}
488 __dict__['_mock_wraps'] = wraps
489 __dict__['_mock_delegate'] = None
490
491 __dict__['_mock_called'] = False
492 __dict__['_mock_call_args'] = None
493 __dict__['_mock_call_count'] = 0
494 __dict__['_mock_call_args_list'] = _CallList()
495 __dict__['_mock_mock_calls'] = _CallList()
496
497 __dict__['method_calls'] = _CallList()
498 __dict__['_mock_unsafe'] = unsafe
499
500 if kwargs:
501 self.configure_mock(**kwargs)
502
503 _safe_super(NonCallableMock, self).__init__(
504 spec, wraps, name, spec_set, parent,
505 _spec_state
506 )
507
508
509 def attach_mock(self, mock, attribute):

Callers

nothing calls this directly

Calls 4

_mock_add_specMethod · 0.95
configure_mockMethod · 0.95
_CallListClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected