Lines Matching refs:instance

108         # If we really want to model an instance of the passed type,
125 def _check_signature(func, mock, skipfirst, instance=False):
126 sig = _get_signature_object(func, instance, skipfirst)
170 # already an instance
181 def _set_signature(mock, original, instance=False):
187 result = _get_signature_object(original, instance, skipfirst)
421 # every instance has its own class
432 instance = _safe_super(NonCallableMock, cls).__new__(new)
433 return instance
682 result.spec, result.spec_set, result.instance,
806 # not set on the instance itself
1210 class or instance) that acts as the specification for the mock object. If
1500 # we can only tell if the instance should be callable if the
1734 their return value (the 'instance') will have the same spec as the class.
2652 def create_autospec(spec, spec_set=False, instance=False, _parent=None,
2665 instance of the class) will have the same spec. You can use a class as the
2666 spec for an instance object by passing `instance=True`. The returned mock
2676 # can't pass a list instance to the mock constructor as it will be
2691 if _kwargs and instance:
2704 if instance:
2710 elif is_type and instance and not _instance_callable(spec):
2730 _check_signature(spec, mock, is_type, instance)
2732 if _parent is not None and not instance:
2735 if is_type and not instance and 'return_value' not in kwargs:
2736 mock.return_value = create_autospec(spec, spec_set, instance=True,
2763 new = _SpecState(original, spec_set, mock, entry, instance)
2782 # so functions created with _set_signature become instance attributes,
2785 # setting as an instance attribute?
2799 # instance attribute - shouldn't skip
2811 # (if looked up on instance, self is already skipped)
2823 name=None, ids=None, instance=False):
2828 self.instance = instance
2835 # instance method
2939 Fetching a `PropertyMock` instance from an object calls the mock, with