1
0
forked from VimPlug/jedi

Some more tests

This commit is contained in:
Dave Halter
2019-07-26 14:51:30 +02:00
parent 41dc5382fa
commit 6a480780f8
2 changed files with 11 additions and 1 deletions

View File

@@ -100,7 +100,11 @@ class TreeSignature(AbstractSignature):
yield param_name
for param_name in kwarg_params:
for param_names in _iter_nodes_for_param(param_name, star_count=2):
itered = list(_iter_nodes_for_param(param_name, star_count=2))
if not itered:
yield param_name
for param_names in itered:
for p in param_names:
if p.string_name not in used_names or p.get_kind() == Parameter.VAR_KEYWORD:
used_names.add(p.string_name)

View File

@@ -109,6 +109,12 @@ def test_tree_signature(Script, environment, code, expected):
'x, /, *, y'),
('combined_redirect(combined_redirect(simple4, simple2), combined_redirect(simple5, kw))',
'a, b, x: int, /, *, a, b, c, **kwargs'),
('combined_redirect(combined_redirect(a, kw), combined_redirect(kw, simple5))',
'a, b, /, *args, y'),
('no_redirect(kw)', '*args, **kwargs'),
('no_redirect(akw)', '*args, **kwargs'),
('no_redirect(simple)', '*args, **kwargs'),
]
)
def test_nested_signatures(Script, environment, combination, expected):