summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-06-30 12:34:28 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-06-30 12:34:28 +0300
commitd41026862179adf431b312f8dc8caeeafd8e9d19 (patch)
treeefbf31a8ee382ae800b3cedbc9aedec7f7ba7365
parent82b63d329b8722d49fe8da38e94209bda2604796 (diff)
downloadpylint-d41026862179adf431b312f8dc8caeeafd8e9d19.tar.gz
Add test for issue #523, which was solved in astroid. Closes issue #523.
-rw-r--r--pylint/test/functional/arguments.py12
-rw-r--r--pylint/test/functional/arguments.txt5
2 files changed, 16 insertions, 1 deletions
diff --git a/pylint/test/functional/arguments.py b/pylint/test/functional/arguments.py
index 8f06ffe..a589af4 100644
--- a/pylint/test/functional/arguments.py
+++ b/pylint/test/functional/arguments.py
@@ -122,3 +122,15 @@ class TypeCheckConstructor(object):
type(self)(1, lala=2) # [no-value-for-parameter,unexpected-keyword-arg]
type(self)(1, 2)
type(self)(first=1, second=2)
+
+
+class Test(object):
+ """ lambda needs Test instance as first argument """
+ lam = lambda self, icon: (self, icon)
+
+ def test(self):
+ self.lam(42)
+ self.lam() # [no-value-for-parameter]
+ self.lam(1, 2, 3) # [too-many-function-args]
+
+Test().lam() # [no-value-for-parameter]
diff --git a/pylint/test/functional/arguments.txt b/pylint/test/functional/arguments.txt
index 835992a..16b3216 100644
--- a/pylint/test/functional/arguments.txt
+++ b/pylint/test/functional/arguments.txt
@@ -24,4 +24,7 @@ too-many-function-args:119:TypeCheckConstructor.test:Too many positional argumen
no-value-for-parameter:121:TypeCheckConstructor.test:No value for argument 'first' in constructor call
no-value-for-parameter:121:TypeCheckConstructor.test:No value for argument 'second' in constructor call
no-value-for-parameter:122:TypeCheckConstructor.test:No value for argument 'second' in constructor call
-unexpected-keyword-arg:122:TypeCheckConstructor.test:Unexpected keyword argument 'lala' in constructor call \ No newline at end of file
+unexpected-keyword-arg:122:TypeCheckConstructor.test:Unexpected keyword argument 'lala' in constructor call
+no-value-for-parameter:133:Test.test:No value for argument 'icon' in function call
+too-many-function-args:134:Test.test:Too many positional arguments for function call
+no-value-for-parameter:136::No value for argument 'icon' in function call \ No newline at end of file