diff options
author | Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> | 2023-05-15 20:51:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 20:51:58 +0200 |
commit | 0a6c21bfab8237431c9f5198068451b243e91448 (patch) | |
tree | 8355cd667c86585e6f8b42b05675b49f1e6951ab /tests | |
parent | f168ad1fa902ddcb024b9824993d250d5d1348ff (diff) | |
download | pylint-git-0a6c21bfab8237431c9f5198068451b243e91448.tar.gz |
Fix a false negative for ``too-many-arguments`` and positional-only and keyword-only arguments (#8674)
Closes #8667
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/n/non_ascii_name/non_ascii_name_pos_and_kwonly_function.py | 2 | ||||
-rw-r--r-- | tests/functional/t/too/too_many_arguments.py | 5 | ||||
-rw-r--r-- | tests/functional/t/too/too_many_arguments.txt | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/tests/functional/n/non_ascii_name/non_ascii_name_pos_and_kwonly_function.py b/tests/functional/n/non_ascii_name/non_ascii_name_pos_and_kwonly_function.py index 651d78f89..09bc5960f 100644 --- a/tests/functional/n/non_ascii_name/non_ascii_name_pos_and_kwonly_function.py +++ b/tests/functional/n/non_ascii_name/non_ascii_name_pos_and_kwonly_function.py @@ -4,7 +4,7 @@ Test for names within keyword and position only function This test is 3.8+ as the columns are not correctly identified by the ast parser < 3.8 """ -# pylint: disable=unused-argument +# pylint: disable=unused-argument,too-many-arguments def name( diff --git a/tests/functional/t/too/too_many_arguments.py b/tests/functional/t/too/too_many_arguments.py index f4a668f53..9c7f3ab08 100644 --- a/tests/functional/t/too/too_many_arguments.py +++ b/tests/functional/t/too/too_many_arguments.py @@ -30,3 +30,8 @@ def func_call(): partial_func = partial(root_function, 1, 2, 3) partial_func() return root_function(1, 2, 3) + + +# +1: [too-many-arguments] +def name1(param1, param2, param3, /, param4, param5, *args, param6="apple", **kwargs): + return param1, param2, param3, param4, param5, param6, args, kwargs diff --git a/tests/functional/t/too/too_many_arguments.txt b/tests/functional/t/too/too_many_arguments.txt index f9749e949..6d727813e 100644 --- a/tests/functional/t/too/too_many_arguments.txt +++ b/tests/functional/t/too/too_many_arguments.txt @@ -1 +1,2 @@ too-many-arguments:3:0:3:19:stupid_function:Too many arguments (9/5):UNDEFINED +too-many-arguments:36:0:36:9:name1:Too many arguments (6/5):UNDEFINED |