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

Method assert_awaited_once

Lib/unittest/mock.py:2369–2376  ·  view source on GitHub ↗

Assert that the mock was awaited exactly once.

(self)

Source from the content-addressed store, hash-verified

2367 raise AssertionError(msg)
2368
2369 def assert_awaited_once(self):
2370 """
2371 Assert that the mock was awaited exactly once.
2372 """
2373 if not self.await_count == 1:
2374 msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
2375 f" Awaited {self.await_count} times.")
2376 raise AssertionError(msg)
2377
2378 def assert_awaited_with(self, /, *args, **kwargs):
2379 """

Calls

no outgoing calls