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.
(self, /, *args, **kwargs)
| 1044 | |
| 1045 | |
| 1046 | def assert_any_call(self, /, *args, **kwargs): |
| 1047 | """assert the mock has been called with the specified arguments. |
| 1048 | |
| 1049 | The assert passes if the mock has *ever* been called, unlike |
| 1050 | `assert_called_with` and `assert_called_once_with` that only pass if |
| 1051 | the call is the most recent one.""" |
| 1052 | expected = self._call_matcher(_Call((args, kwargs), two=True)) |
| 1053 | cause = expected if isinstance(expected, Exception) else None |
| 1054 | actual = [self._call_matcher(c) for c in self.call_args_list] |
| 1055 | if cause or expected not in _AnyComparer(actual): |
| 1056 | expected_string = self._format_mock_call_signature(args, kwargs) |
| 1057 | raise AssertionError( |
| 1058 | '%s call not found' % expected_string |
| 1059 | ) from cause |
| 1060 | |
| 1061 | |
| 1062 | def _get_child_mock(self, /, **kw): |