If the _Call has no name then it will match any name.
"""
- def __new__(cls, value=(), name=None, parent=None, two=False,
+ def __new__(cls, value=(), name='', parent=None, two=False,
from_kall=True):
- name = ''
args = ()
kwargs = {}
_len = len(value)
other_args = _Call(((1, 2), {'a': 3}))
self.assertEqual(args, other_args)
+ def test_call_with_name(self):
+ self.assertEqual(_Call((), 'foo')[0], 'foo')
+ self.assertEqual(_Call((('bar', 'barz'),),)[0], '')
+ self.assertEqual(_Call((('bar', 'barz'), {'hello': 'world'}),)[0], '')
+
class SpecSignatureTest(unittest.TestCase):
Library
-------
+- Issue #28961: Fix unittest.mock._Call helper: don't ignore the name parameter
+ anymore. Patch written by Jiajun Huang.
+
- bpo-29532: Altering a kwarg dictionary passed to functools.partial()
no longer affects a partial object after creation.