1
0
forked from VimPlug/jedi

Make sure that equals will only be added to keyword arguments and not just randomly

This commit is contained in:
Dave Halter
2020-01-01 18:55:38 +01:00
parent 9dc18054ee
commit 54bd0b437f
5 changed files with 34 additions and 20 deletions

View File

@@ -149,6 +149,18 @@ def test_with_stmt_error_recovery(Script):
assert Script('with open('') as foo: foo.\na').complete(line=1)
def test_function_param_usage(Script):
c, = Script('def func(foo_value):\n str(foo_valu').complete()
assert c.complete == 'e'
assert c.name == 'foo_value'
c1, c2 = Script('def func(foo_value):\n func(foo_valu').complete()
assert c1.complete == 'e'
assert c1.name == 'foo_value'
assert c2.complete == 'e='
assert c2.name == 'foo_value='
@pytest.mark.parametrize(
'code, has_keywords', (
('', True),