summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-07-01 20:14:45 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-07-01 20:15:20 +0200
commitc881f3339f0086851595a31c3101ed659fa5e327 (patch)
treeb558d037a26774174648dda902805e6e4bef1746
parent6f066733e23a61d83580cd1898e6b8afab8fafea (diff)
downloadpylint-git-issue-1191.tar.gz
[too-many-argument] Add functional tests for issue #1191issue-1191
-rw-r--r--tests/functional/t/too/too_many_arguments.py29
-rw-r--r--tests/functional/t/too/too_many_arguments.rc2
2 files changed, 29 insertions, 2 deletions
diff --git a/tests/functional/t/too/too_many_arguments.py b/tests/functional/t/too/too_many_arguments.py
index 689745e27..8802d7130 100644
--- a/tests/functional/t/too/too_many_arguments.py
+++ b/tests/functional/t/too/too_many_arguments.py
@@ -1,6 +1,6 @@
-# pylint: disable=missing-docstring,wrong-import-position
+# pylint: disable=missing-docstring,wrong-import-position,too-few-public-methods
-def stupid_function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9): # [too-many-arguments]
+def stupid_function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9): # [too-many-arguments]
return arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
@@ -30,3 +30,28 @@ def func_call():
partial_func = partial(root_function, 1, 2, 3)
partial_func()
return root_function(1, 2, 3)
+
+
+class NoParentClass: # pylint: disable=too-many-arguments
+ """Test for https://github.com/PyCQA/pylint/issues/1191"""
+ def __init__(self, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
+ self.arg_1 = arg_1
+ self.arg_2 = arg_2
+ self.arg_3 = arg_3
+ self.arg_4 = arg_4
+ self.arg_5 = arg_5
+ self.arg_6 = arg_6
+
+class Base:
+ pass
+
+
+class ChildOfBase(Base): # pylint: disable=too-many-arguments
+ """Test for https://github.com/PyCQA/pylint/issues/1191"""
+ def __init__(self, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
+ self.arg_1 = arg_1
+ self.arg_2 = arg_2
+ self.arg_3 = arg_3
+ self.arg_4 = arg_4
+ self.arg_5 = arg_5
+ self.arg_6 = arg_6
diff --git a/tests/functional/t/too/too_many_arguments.rc b/tests/functional/t/too/too_many_arguments.rc
new file mode 100644
index 000000000..373e877b0
--- /dev/null
+++ b/tests/functional/t/too/too_many_arguments.rc
@@ -0,0 +1,2 @@
+[DESIGN]
+max-args=5