diff -r 64afd5cab40a -r b21bb0a21b52 Lib/unittest/mock.py --- a/Lib/unittest/mock.py Tue Dec 13 19:03:51 2016 -0500 +++ b/Lib/unittest/mock.py Wed Dec 14 10:39:42 2016 +0800 @@ -1961,9 +1961,8 @@ 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) diff -r 64afd5cab40a -r b21bb0a21b52 Lib/unittest/test/testmock/testhelpers.py --- a/Lib/unittest/test/testmock/testhelpers.py Tue Dec 13 19:03:51 2016 -0500 +++ b/Lib/unittest/test/testmock/testhelpers.py Wed Dec 14 10:39:42 2016 +0800 @@ -307,6 +307,21 @@ self.assertEqual(args, other_args) + def test_call_with_name(self): + self.assertEqual( + 'foo', + _Call((), 'foo')[0], + ) + self.assertEqual( + '', + _Call((('bar', 'barz'), ), )[0] + ) + self.assertEqual( + '', + _Call((('bar', 'barz'), {'hello': 'world'}), )[0] + ) + + class SpecSignatureTest(unittest.TestCase): def _check_someclass_mock(self, mock): @@ -844,6 +859,7 @@ # property check_data_descriptor(foo.prop) # property subclass + import ipdb; ipdb.set_trace() # TODO remove it check_data_descriptor(foo.subprop) # class __slot__ check_data_descriptor(foo.slot)