Lines Matching defs:method
103 # Skip the `cls` argument of a class method
105 # Use the original decorated method to extract the correct function signature
631 method call:
633 >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
771 msg = 'Attempting to set unsupported magic method %r.' % name
783 # but not method calls
834 * If call objects are asserted against a method/function like obj.meth1
836 return the spec_signature of the method/function being asserted against.
869 This is a best effort method which relies on the spec's signature,
1039 # Any synchronous method on AsyncMock becomes a MagicMock
1115 # stub method that can be replaced with one with a specific signature
1120 # can't use self in-case a function / method we are mocking uses self
1178 # executed separately from their call, also AsyncMock overrides this method
1365 # NB. Keep the method in sync with decorate_async_callable()
1382 # NB. Keep the method in sync with decorate_callable()
1748 decorating each test method in the class. This reduces the boilerplate
1750 tests by looking for method names that start with `patch.TEST_PREFIX`.
1874 # dict like object with no copy method
1887 # dict like object with no update method
1988 def method(self, /, *args, **kw):
1990 method.__name__ = name
1991 return method
1995 '__%s__' % method for method in
2085 def _set_return_value(mock, method, name):
2088 method.return_value = fixed
2094 method.return_value = return_value
2099 method.side_effect = side_effector(mock)
2201 # function/method, which in this case it is not (since it is an
2810 # Normal method => skip if looked up on type
2835 # instance method