MCPcopy Index your code
hub / github.com/python/cpython / reset_mock

Method reset_mock

Lib/unittest/mock.py:2245–2255  ·  view source on GitHub ↗
(self, /, *args, return_value: bool = False, **kwargs)

Source from the content-addressed store, hash-verified

2243 self._mock_set_magics()
2244
2245 def reset_mock(self, /, *args, return_value: bool = False, **kwargs):
2246 if (
2247 return_value
2248 and self._mock_name
2249 and _is_magic(self._mock_name)
2250 ):
2251 # Don't reset return values for magic methods,
2252 # otherwise `m.__str__` will start
2253 # to return `MagicMock` instances, instead of `str` instances.
2254 return_value = False
2255 super().reset_mock(*args, return_value=return_value, **kwargs)
2256
2257
2258class MagicProxy(Base):

Calls 2

_is_magicFunction · 0.85
superClass · 0.85