mirror of
https://github.com/davidhalter/parso.git
synced 2026-01-02 01:23:41 +08:00
Add 'named arguments must follow bare *' issue and a few conftest tweaks.
This commit is contained in:
@@ -79,3 +79,12 @@ def b(a:int=1):
|
||||
|
||||
if alpha[:-i]:
|
||||
*a, b = (1, 2, 3)
|
||||
|
||||
|
||||
# Named only arguments
|
||||
def foo(*, asdf):
|
||||
pass
|
||||
|
||||
|
||||
def foo2(bar, *, asdf=2):
|
||||
pass
|
||||
|
||||
@@ -174,3 +174,12 @@ def test_future_import_first():
|
||||
assert is_issue('"";1\n' + i1)
|
||||
assert is_issue('""\n%s\nfrom x import a\n%s', i1, i2)
|
||||
assert is_issue('%s\n""\n%s', i1, i2)
|
||||
|
||||
|
||||
def test_named_argument_issues(works_not_in_py):
|
||||
message = works_not_in_py.get_error_message('def foo(*): pass')
|
||||
if works_not_in_py.version.startswith('2'):
|
||||
message
|
||||
|
||||
works_not_in_py.assert_no_error_in_passing('def foo(*, name): pass')
|
||||
works_not_in_py.assert_no_error_in_passing('def foo(bar, *, name=1): pass')
|
||||
|
||||
Reference in New Issue
Block a user