[3.8] bpo-38857: AsyncMock fix for awaitable values and StopIteration fix [3.8] (GH-17269) (#17304)
(cherry picked from commit 046442d02bcc6e848e71e93e47f6cde9e279e993)
Co-authored-by: Jason Fried <fried@fb.com>
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
index 746cf76..ebfaf7d 100644
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -873,7 +873,7 @@
exception,
- if ``side_effect`` is an iterable, the async function will return the
next value of the iterable, however, if the sequence of result is
- exhausted, ``StopIteration`` is raised immediately,
+ exhausted, ``StopAsyncIteration`` is raised immediately,
- if ``side_effect`` is not defined, the async function will return the
value defined by ``return_value``, hence, by default, the async function
returns a new :class:`AsyncMock` object.