@@ -189,7 +189,7 @@ code if they are used incorrectly:
189
189
>>> mock_function(' wrong arguments' )
190
190
Traceback (most recent call last):
191
191
...
192
- TypeError: <lambda>() takes exactly 3 arguments (1 given)
192
+ TypeError: missing a required argument: 'b'
193
193
194
194
:func: `create_autospec ` can also be used on classes, where it copies the signature of
195
195
the ``__init__ `` method, and on callable objects where it copies the signature of
@@ -315,6 +315,7 @@ the *new_callable* argument to :func:`patch`.
315
315
Traceback (most recent call last):
316
316
...
317
317
AssertionError: Expected 'method' to have been called once. Called 2 times.
318
+ Calls: [call(), call()].
318
319
319
320
.. versionadded :: 3.6
320
321
@@ -342,7 +343,7 @@ the *new_callable* argument to :func:`patch`.
342
343
Traceback (most recent call last):
343
344
...
344
345
AssertionError: Expected 'mock' to be called once. Called 2 times.
345
-
346
+ Calls: [call('foo', bar='baz'), call('other', bar='values')].
346
347
347
348
.. method :: assert_any_call(*args, **kwargs)
348
349
@@ -392,6 +393,7 @@ the *new_callable* argument to :func:`patch`.
392
393
Traceback (most recent call last):
393
394
...
394
395
AssertionError: Expected 'hello' to not have been called. Called 1 times.
396
+ Calls: [call()].
395
397
396
398
.. versionadded :: 3.5
397
399
@@ -954,7 +956,7 @@ object::
954
956
>>> asyncio.run(main())
955
957
>>> mock.assert_awaited_once()
956
958
>>> asyncio.run(main())
957
- >>> mock.method. assert_awaited_once()
959
+ >>> mock.assert_awaited_once()
958
960
Traceback (most recent call last):
959
961
...
960
962
AssertionError: Expected mock to have been awaited once. Awaited 2 times.
@@ -972,7 +974,7 @@ object::
972
974
>>> mock.assert_awaited_with(' other' )
973
975
Traceback (most recent call last):
974
976
...
975
- AssertionError: expected call not found.
977
+ AssertionError: expected await not found.
976
978
Expected: mock('other')
977
979
Actual: mock('foo', bar='bar')
978
980
0 commit comments