From d41026862179adf431b312f8dc8caeeafd8e9d19 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Tue, 30 Jun 2015 12:34:28 +0300 Subject: Add test for issue #523, which was solved in astroid. Closes issue #523. --- pylint/test/functional/arguments.py | 12 ++++++++++++ pylint/test/functional/arguments.txt | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1