diff options
author | Xtreak <tir.karthi@gmail.com> | 2019-05-21 08:47:17 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-21 08:47:17 (GMT) |
commit | e7cb23bf2079087068a08502f96fdf20b317d69c (patch) | |
tree | 8d975456ed991b306c917eee52d714d0df734be4 /Doc | |
parent | d0ebf13e50dd736cdb355fa42c23837abbb88127 (diff) | |
download | cpython-e7cb23bf2079087068a08502f96fdf20b317d69c.zip cpython-e7cb23bf2079087068a08502f96fdf20b317d69c.tar.gz cpython-e7cb23bf2079087068a08502f96fdf20b317d69c.tar.bz2 |
Fix RuntimeWarning in unittest.mock asyncio example (GH-13449)
* This PR fixes the `RuntimeWarning` in `inspect.isawaitable(mock())` where `mock()` was not awaited.
* Fix typo in asynctest project.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/unittest.mock.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst index 21e4709..163da9a 100644 --- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -862,7 +862,7 @@ object:: >>> mock = AsyncMock() >>> asyncio.iscoroutinefunction(mock) True - >>> inspect.isawaitable(mock()) + >>> inspect.isawaitable(mock()) # doctest: +SKIP True The result of ``mock()`` is an async function which will have the outcome @@ -888,7 +888,7 @@ object:: >>> mock = MagicMock(async_func) >>> mock <MagicMock spec='function' id='...'> - >>> mock() + >>> mock() # doctest: +SKIP <coroutine object AsyncMockMixin._mock_call at ...> .. method:: assert_awaited() |