Merge 3.6

This commit is contained in:
Victor Stinner 2017-01-06 18:16:07 +01:00
commit cd992bbe73
3 changed files with 18 additions and 2 deletions

View File

@ -1951,9 +1951,8 @@ class _Call(tuple):
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)

View File

@ -306,6 +306,20 @@ def test_two_args_call(self):
other_args = _Call(((1, 2), {'a': 3}))
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):

View File

@ -210,6 +210,9 @@ Core and Builtins
Library
-------
- Issue #28961: Fix unittest.mock._Call helper: don't ignore the name parameter
anymore. Patch written by Jiajun Huang.
- Issue #15812: inspect.getframeinfo() now correctly shows the first line of
a context. Patch by Sam Breese.