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

Method assert_not_called

Lib/unittest/mock.py:939–947  ·  view source on GitHub ↗

assert that the mock was never called.

(self)

Source from the content-addressed store, hash-verified

937 return _call
938
939 def assert_not_called(self):
940 """assert that the mock was never called.
941 """
942 if self.call_count != 0:
943 msg = ("Expected '%s' to not have been called. Called %s times.%s"
944 % (self._mock_name or 'mock',
945 self.call_count,
946 self._calls_repr()))
947 raise AssertionError(msg)
948
949 def assert_called(self):
950 """assert that the mock was called at least once

Calls 1

_calls_reprMethod · 0.95