summaryrefslogtreecommitdiff
path: root/tests/functional/c/class_scope.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/c/class_scope.py')
-rw-r--r--tests/functional/c/class_scope.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/functional/c/class_scope.py b/tests/functional/c/class_scope.py
new file mode 100644
index 000000000..309ebd6da
--- /dev/null
+++ b/tests/functional/c/class_scope.py
@@ -0,0 +1,22 @@
+# pylint: disable=R0903,W0232, useless-object-inheritance
+"""check for scope problems"""
+
+__revision__ = None
+
+class Well(object):
+ """well"""
+ attr = 42
+ get_attr = lambda arg=attr: arg * 24
+ # +1: [used-before-assignment]
+ get_attr_bad = lambda arg=revattr: revattr * 42
+ revattr = 24
+ bad_lambda = lambda: get_attr_bad # [undefined-variable]
+
+ class Data(object):
+ """base hidden class"""
+ class Sub(Data):
+ """whaou, is Data found???"""
+ attr = Data() # [undefined-variable]
+ def func(self):
+ """check Sub is not defined here"""
+ return Sub(), self # [undefined-variable]