Searched refs:AsyncMock (Results 1 – 13 of 13) sorted by relevance
/third_party/python/Lib/unittest/test/testmock/ |
D | testasync.py | 10 from unittest.mock import (ANY, call, AsyncMock, patch, MagicMock, Mock, 82 self.assertIsInstance(mock_method, AsyncMock) 89 self.assertIsInstance(mock_method, AsyncMock) 96 self.assertIsInstance(mock_method, AsyncMock) 107 self.assertIsInstance(async_func, AsyncMock) 108 self.assertIsInstance(async_func_args, AsyncMock) 137 self.assertIsInstance(mock_method, AsyncMock) 143 with patch(f"{__name__}.async_func", AsyncMock()): 144 self.assertIsInstance(async_func, AsyncMock) 152 mock = AsyncMock() [all …]
|
D | testmagicmethods.py | 5 from unittest.mock import AsyncMock, Mock, MagicMock, _magics 274 mock = AsyncMock() 290 self.assertIsInstance(mock.__aenter__, AsyncMock) 291 self.assertIsInstance(mock.__aexit__, AsyncMock) 316 self.assertIsInstance(mock.__aenter__, AsyncMock) 317 self.assertIsInstance(mock.__aexit__, AsyncMock)
|
D | testmock.py | 13 NonCallableMagicMock, AsyncMock, _Call, _CallList, 1816 AsyncMock): 2189 Mock, MagicMock, NonCallableMock, NonCallableMagicMock, AsyncMock
|
/third_party/mesa3d/bin/ |
D | gen_release_notes_test.py | 153 mock_com = mock.AsyncMock(return_value=(textwrap.dedent(content).encode(), '')) 156 mock_exec = mock.AsyncMock(return_value=mock_p) 159 … mock.patch('bin.gen_release_notes.gather_commits', mock.AsyncMock(return_value='sha\n')):
|
/third_party/python/Doc/library/ |
D | unittest.mock.rst | 208 from unittest.mock import patch, call, Mock, MagicMock, PropertyMock, AsyncMock 859 .. class:: AsyncMock(spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec… 861 An asynchronous version of :class:`MagicMock`. The :class:`AsyncMock` object will 865 >>> mock = AsyncMock() 883 returns a new :class:`AsyncMock` object. 898 Setting the *spec* of a :class:`Mock`, :class:`MagicMock`, or :class:`AsyncMock` 901 parent mock is :class:`AsyncMock` or :class:`MagicMock`) or :class:`Mock` (if 903 :class:`AsyncMock`. 911 >>> a_mock = AsyncMock(ExampleClass) 915 <AsyncMock name='mock.async_foo' id='...'> [all …]
|
D | unittest.mock-examples.rst | 17 from unittest.mock import Mock, MagicMock, AsyncMock, patch, call, sentinel 283 Since Python 3.8, ``AsyncMock`` and ``MagicMock`` have support to mock 288 >>> mock = MagicMock() # AsyncMock also works here 300 Since Python 3.8, ``AsyncMock`` and ``MagicMock`` have support to mock 302 By default, ``__aenter__`` and ``__aexit__`` are ``AsyncMock`` instances that 311 >>> mock_instance = MagicMock(AsyncContextManager()) # AsyncMock also works here
|
/third_party/python/Lib/unittest/ |
D | mock.py | 52 if _is_instance_mock(obj) and not isinstance(obj, AsyncMock): 1005 return AsyncMock(**kw) 1015 klass = AsyncMock 1022 klass = AsyncMock 1461 Klass = AsyncMock 1476 Klass = AsyncMock 2352 class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): class 2672 Klass = AsyncMock 2738 child_klass = AsyncMock
|
/third_party/python/Misc/NEWS.d/ |
D | 3.9.0a2.rst | 507 AsyncMock now returns StopAsyncIteration on the exhaustion of a side_effects 518 AsyncMock fix for return values that are awaitable types. This also covers
|
D | 3.9.0a1.rst | 1471 Removes _AwaitEvent from AsyncMock. 1502 Any synchronous magic methods on an AsyncMock now return a MagicMock. Any 1503 asynchronous magic methods on a MagicMock now return an AsyncMock. 1591 Changes AsyncMock call count and await count to be two different counters. 1776 Fixes AsyncMock so it doesn't crash when used with AsyncContextManagers or 1816 Remove `__code__` check in AsyncMock that incorrectly evaluated function
|
D | 3.9.0a4.rst | 528 Allow AsyncMock to correctly patch static/class methods
|
D | 3.8.0b1.rst | 635 Handle late binding and attribute access in :class:`unittest.mock.AsyncMock` 1429 Added AsyncMock to support using unittest to mock asyncio coroutines. Patch
|
D | 3.9.0a5.rst | 483 Ensure :attr:`unittest.mock.AsyncMock.await_args_list` has call objects in
|
/third_party/python/Doc/whatsnew/ |
D | 3.8.rst | 1360 Added :class:`~unittest.mock.AsyncMock` to support an asynchronous version of
|