Lines Matching refs:AsyncMock
208 from unittest.mock import patch, call, Mock, MagicMock, PropertyMock, AsyncMock
858 .. class:: AsyncMock(spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec…
860 An asynchronous version of :class:`MagicMock`. The :class:`AsyncMock` object will
864 >>> mock = AsyncMock()
882 returns a new :class:`AsyncMock` object.
897 Setting the *spec* of a :class:`Mock`, :class:`MagicMock`, or :class:`AsyncMock`
900 parent mock is :class:`AsyncMock` or :class:`MagicMock`) or :class:`Mock` (if
902 :class:`AsyncMock`.
910 >>> a_mock = AsyncMock(ExampleClass)
914 <AsyncMock name='mock.async_foo' id='...'>
919 <AsyncMock name='mock.async_foo' id='...'>
928 >>> mock = AsyncMock()
946 >>> mock = AsyncMock()
962 >>> mock = AsyncMock()
980 >>> mock = AsyncMock()
996 >>> mock = AsyncMock()
1020 >>> mock = AsyncMock()
1039 >>> mock = AsyncMock()
1051 >>> mock = AsyncMock()
1067 >>> mock = AsyncMock()
1086 >>> mock = AsyncMock()
1343 :class:`AsyncMock` if the patched object is an async function or
1363 that will be called to create the *new* object. By default :class:`AsyncMock`
1406 :class:`AsyncMock` if the patched object is asynchronous, to
1531 :func:`patch` now returns an :class:`AsyncMock` if the target is an async function.
2342 :func:`create_autospec` now returns an :class:`AsyncMock` if the target is