[issue28961] unittest.mock._Call ignores `name` parameter

Berker Peksag report at bugs.python.org
Sat Jan 7 00:04:12 EST 2017


Berker Peksag added the comment:

IIRC 3.5.3rc1 is already tagged so the 3.5 branch is open for 3.5.4. Anything that needs to be in 3.5.3 should be cherry-picked by the RM at this point if I'm not mistaken (and note that I don't have time check, but 3.5.3 may be the last bugfix release of 3.5 series so you may just skip 3.5 :))

Like I already said in msg284589, the test code doesn't follow the current style in Lib/unittest/test/testmock/testhelpers.py and it can be simplified like the following patch:

     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]
-        )
+        self.assertEqual(_Call((), 'foo')[0], 'foo')
+        self.assertEqual(_Call((('bar', 'barz'),),)[0], '')
+        self.assertEqual(_Call((('bar', 'barz'), {'hello': 'world'}),)[0], '')

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28961>
_______________________________________


More information about the Python-bugs-list mailing list