def assert_any_call ( self , * args , * * kwargs ) : kall = call ( * args , * * kwargs ) if kall not in self . call_args_list : expected_string = self . _format_mock_call_signature ( args , kwargs ) raise AssertionError ( '%s call not found' % expected_string )
python mock call check all calls
assert the mock has been called with the specified arguments .
def assert_any_call(self, *args, **kwargs):
        """assert the mock has been called with the specified arguments.

        The assert passes if the mock has *ever* been called, unlike
        `assert_called_with` and `assert_called_once_with` that only pass if
        the call is the most recent one."""
        kall = call(*args, **kwargs)
        if kall not in self.call_args_list:
            expected_string = self._format_mock_call_signature(args, kwargs)
            raise AssertionError(
                '%s call not found' % expected_string
            )