diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2015-09-09 20:40:11 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2015-09-09 20:40:11 (GMT) |
commit | 17ebaa93d42b396a6538c8e48dfdae70bac489ee (patch) | |
tree | 93fd0c0d1a89bc95b1e47aedc8b77c7e501e1cb8 /Lib/unittest/mock.py | |
parent | 0ae505e7d39726cdc8c279c7cb4908e12a39d998 (diff) | |
parent | 29bf4d403dd2cb8875e224f50a4cfeea177d33ae (diff) | |
download | cpython-17ebaa93d42b396a6538c8e48dfdae70bac489ee.zip cpython-17ebaa93d42b396a6538c8e48dfdae70bac489ee.tar.gz cpython-17ebaa93d42b396a6538c8e48dfdae70bac489ee.tar.bz2 |
Issue #24857: Comparing call_args to a long sequence now correctly returns a
boolean result instead of raising an exception.
Patch by A Kaptur.
Diffstat (limited to 'Lib/unittest/mock.py')
-rw-r--r-- | Lib/unittest/mock.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 4c58639..99ce1e2 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -2005,8 +2005,7 @@ class _Call(tuple): else: other_args = () other_kwargs = value - else: - # len 2 + elif len_other == 2: # could be (name, args) or (name, kwargs) or (args, kwargs) first, second = other if isinstance(first, str): @@ -2017,6 +2016,8 @@ class _Call(tuple): other_args, other_kwargs = (), second else: other_args, other_kwargs = first, second + else: + return False if self_name and other_name != self_name: return False |