summaryrefslogtreecommitdiff
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
authorKarthikeyan Singaravelan <tir.karthi@gmail.com>2020-03-11 20:36:12 +0530
committerGitHub <noreply@github.com>2020-03-11 15:06:12 +0000
commite553f204bf0e39b1d701a364bc71b286acb9433f (patch)
tree7e7a319f0a86edec4a9d8abebf435934b0e1c829 /Lib/unittest/mock.py
parentfde44ae6d08d3df79554155b1cf079e73a8fabdd (diff)
downloadcpython-git-e553f204bf0e39b1d701a364bc71b286acb9433f.tar.gz
bpo-39915: Ensure await_args_list is updated according to the order in which coroutines were awaited (GH-18924)
Create call objects with awaited arguments instead of using call_args which has only last call value.
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r--Lib/unittest/mock.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index 9e692981a2..20daf724c1 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -2171,7 +2171,7 @@ class AsyncMockMixin(Base):
# This is nearly just like super(), except for special handling
# of coroutines
- _call = self.call_args
+ _call = _Call((args, kwargs), two=True)
self.await_count += 1
self.await_args = _call
self.await_args_list.append(_call)