summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2017-02-26 13:06:11 (GMT)
committerGitHub <noreply@github.com>2017-02-26 13:06:11 (GMT)
commit6b585fddc9ad472d8c962aba26cf25809451b2b5 (patch)
tree3e683b83e864886d59c14b06426ddbce612b957d /Lib/unittest/test
parent4c784632f7cb5ede6df4b1b20cdfae155069a81b (diff)
downloadcpython-6b585fddc9ad472d8c962aba26cf25809451b2b5.zip
cpython-6b585fddc9ad472d8c962aba26cf25809451b2b5.tar.gz
cpython-6b585fddc9ad472d8c962aba26cf25809451b2b5.tar.bz2
Fix unittest.mock._Call: don't ignore name (#307)
Issue #28961: Fix unittest.mock._Call helper: don't ignore the name parameter anymore. Patch written by Jiajun Huang. (cherry picked from commits 84b6fb0eea29b3b28a1a11124526b01ec0c9d17a and dea1536fd3a8424d537794cd53715df0989cbbe1) Conflicts: Misc/NEWS
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/testmock/testhelpers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/unittest/test/testmock/testhelpers.py
index 3477634..d2202a7 100644
--- a/Lib/unittest/test/testmock/testhelpers.py
+++ b/Lib/unittest/test/testmock/testhelpers.py
@@ -306,6 +306,11 @@ class CallTest(unittest.TestCase):
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):