summaryrefslogtreecommitdiff
path: root/pylint/test/unittest_checker_variables.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/test/unittest_checker_variables.py')
-rw-r--r--pylint/test/unittest_checker_variables.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pylint/test/unittest_checker_variables.py b/pylint/test/unittest_checker_variables.py
index 9bfabbba4..5e919d08d 100644
--- a/pylint/test/unittest_checker_variables.py
+++ b/pylint/test/unittest_checker_variables.py
@@ -180,6 +180,7 @@ class TestVariablesCheckerWithTearDown(CheckerTestCase):
with self.assertNoMessages():
self.walk(node)
+
def test_scope_in_defaults(self):
# Should not emit undefined variable
node = astroid.extract_node('''
@@ -201,6 +202,18 @@ class TestVariablesCheckerWithTearDown(CheckerTestCase):
with self.assertNoMessages():
self.walk(node)
+ def test_nested_lambda(self):
+ """Make sure variables from parent lambdas
+ aren't noted as undefined
+
+ https://github.com/PyCQA/pylint/issues/760
+ """
+ node = astroid.parse('''
+ lambda x: lambda: x + 1
+ ''')
+ with self.assertNoMessages():
+ self.walk(node)
+
class TestMissingSubmodule(CheckerTestCase):
CHECKER_CLASS = variables.VariablesChecker