MCPcopy Index your code
hub / github.com/RustPython/RustPython / assert_any_await

Method assert_any_await

Lib/unittest/mock.py:2400–2411  ·  view source on GitHub ↗

Assert the mock has ever been awaited with the specified arguments.

(self, /, *args, **kwargs)

Source from the content-addressed store, hash-verified

2398 return self.assert_awaited_with(*args, **kwargs)
2399
2400 def assert_any_await(self, /, *args, **kwargs):
2401 """
2402 Assert the mock has ever been awaited with the specified arguments.
2403 """
2404 expected = self._call_matcher(_Call((args, kwargs), two=True))
2405 cause = expected if isinstance(expected, Exception) else None
2406 actual = [self._call_matcher(c) for c in self.await_args_list]
2407 if cause or expected not in _AnyComparer(actual):
2408 expected_string = self._format_mock_call_signature(args, kwargs)
2409 raise AssertionError(
2410 '%s await not found' % expected_string
2411 ) from cause
2412
2413 def assert_has_awaits(self, calls, any_order=False):
2414 """

Calls 5

_CallClass · 0.85
isinstanceFunction · 0.85
_AnyComparerClass · 0.85
_call_matcherMethod · 0.80