From 883841ad3104aa009d28aa1f5feb82d957f965eb Mon Sep 17 00:00:00 2001 From: Elizabeth Uselton Date: Sat, 20 Jul 2019 08:58:14 -0700 Subject: [PATCH] bpo-37555: Fixed call on bound arguments to respect args and kwargs --- Lib/unittest/mock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 01925539b349..95c728fa6604 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -814,7 +814,8 @@ class NonCallableMock(Base): else: name, args, kwargs = _call try: - return call(name, sig.bind(*args, **kwargs)) + bound_call = sig.bind(*args, **kwargs) + return call(name, bound_call.args, bound_call.kwargs) except TypeError as e: return e.with_traceback(None) else: -- 2.47.3