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

Method assert_called

Lib/unittest/mock.py:949–955  ·  view source on GitHub ↗

assert that the mock was called at least once

(self)

Source from the content-addressed store, hash-verified

947 raise AssertionError(msg)
948
949 def assert_called(self):
950 """assert that the mock was called at least once
951 """
952 if self.call_count == 0:
953 msg = ("Expected '%s' to have been called." %
954 (self._mock_name or 'mock'))
955 raise AssertionError(msg)
956
957 def assert_called_once(self):
958 """assert that the mock was called only once.

Calls

no outgoing calls