summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-03-14 07:12:57 (GMT)
committerGitHub <noreply@github.com>2020-03-14 07:12:57 (GMT)
commitf6bdac1bf718eab0cc5b6554f363f21252d245ce (patch)
tree840a7320e5dc03a3994d85e95cc23a7801ef278d /Lib/unittest/mock.py
parentd3af92ecc2f41d920e9a66211e2ab631fc473163 (diff)
downloadcpython-f6bdac1bf718eab0cc5b6554f363f21252d245ce.zip
cpython-f6bdac1bf718eab0cc5b6554f363f21252d245ce.tar.gz
cpython-f6bdac1bf718eab0cc5b6554f363f21252d245ce.tar.bz2
bpo-39915: Ensure await_args_list is updated according to the order in which coroutines were awaited (GH-18927)
Create call objects with awaited arguments instead of using call_args which has only last call value. (cherry picked from commit e553f204bf0e39b1d701a364bc71b286acb9433f) Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
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 204b3e7..a8f74a9 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -2136,7 +2136,7 @@ class AsyncMockMixin(Base):
# This is nearly just like super(), except for sepcial 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)