summaryrefslogtreecommitdiff
path: root/tests/testdata/python3/data/module.py
diff options
context:
space:
mode:
authorAshley Whetter <AWhetter@users.noreply.github.com>2019-10-15 01:49:26 -0700
committerClaudiu Popa <pcmanticore@gmail.com>2019-10-15 10:49:26 +0200
commit2f288598de485c6af25788fc917139b48c31c474 (patch)
tree3b52b2994c90018a2db2854adca0928c4bfe1162 /tests/testdata/python3/data/module.py
parent73babe3d536ffc4da94e59c705eb6a8c3e5822ef (diff)
downloadastroid-git-2f288598de485c6af25788fc917139b48c31c474.tar.gz
Moved tests out of package directory (#704)
Diffstat (limited to 'tests/testdata/python3/data/module.py')
-rw-r--r--tests/testdata/python3/data/module.py89
1 files changed, 89 insertions, 0 deletions
diff --git a/tests/testdata/python3/data/module.py b/tests/testdata/python3/data/module.py
new file mode 100644
index 00000000..25913cbf
--- /dev/null
+++ b/tests/testdata/python3/data/module.py
@@ -0,0 +1,89 @@
+"""test module for astroid
+"""
+
+__revision__ = '$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $'
+from astroid.node_classes import Name as NameNode
+from astroid import modutils
+from astroid.utils import *
+import os.path
+MY_DICT = {}
+
+def global_access(key, val):
+ """function test"""
+ local = 1
+ MY_DICT[key] = val
+ for i in val:
+ if i:
+ del MY_DICT[i]
+ continue
+ else:
+ break
+ else:
+ return
+
+
+class YO:
+ """hehe
+ haha"""
+ a = 1
+
+ def __init__(self):
+ try:
+ self.yo = 1
+ except ValueError as ex:
+ pass
+ except (NameError, TypeError):
+ raise XXXError()
+ except:
+ raise
+
+
+
+class YOUPI(YO):
+ class_attr = None
+
+ def __init__(self):
+ self.member = None
+
+ def method(self):
+ """method
+ test"""
+ global MY_DICT
+ try:
+ MY_DICT = {}
+ local = None
+ autre = [a for (a, b) in MY_DICT if b]
+ if b in autre:
+ return
+ elif a in autre:
+ return 'hehe'
+ global_access(local, val=autre)
+ finally:
+ return local
+
+ def static_method():
+ """static method test"""
+ assert MY_DICT, '???'
+ static_method = staticmethod(static_method)
+
+ def class_method(cls):
+ """class method test"""
+ exec(a, b)
+ class_method = classmethod(class_method)
+
+
+def four_args(a, b, c, d):
+ """four arguments (was nested_args)"""
+ while 1:
+ if a:
+ break
+ a += +1
+ else:
+ b += -2
+ if c:
+ d = a and (b or c)
+ else:
+ c = a and b or d
+ list(map(lambda x, y: (y, x), a))
+redirect = four_args
+