summaryrefslogtreecommitdiff
path: root/tests/run/duplicate_keyword_in_call.py
blob: aba5772c373c4fbff84ae3f0db75e262ad5474b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# mode: run
# tag: kwargs, call
# ticket: t717

def f(**kwargs):
    return sorted(kwargs.items())

def test_call(kwargs):
    """
    >>> kwargs = {'b' : 2}
    >>> f(a=1, **kwargs)
    [('a', 1), ('b', 2)]
    >>> test_call(kwargs)
    [('a', 1), ('b', 2)]

    >>> kwargs = {'a' : 2}
    >>> f(a=1, **kwargs)    # doctest: +ELLIPSIS
    Traceback (most recent call last):
    TypeError: ...got multiple values for keyword argument 'a'

    >>> test_call(kwargs)   # doctest: +ELLIPSIS
    Traceback (most recent call last):
    TypeError: ...got multiple values for keyword argument 'a'
    """
    return f(a=1, **kwargs)