summaryrefslogtreecommitdiff
path: root/tests/testdata/python3/data
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-02-08 22:13:21 +0100
committerGitHub <noreply@github.com>2022-02-08 22:13:21 +0100
commitb5e3e71068c8eeb0ee5bb7770e6e26d207b7b92e (patch)
treec2ea8ccbec6605a160bd126a254c6360c229819a /tests/testdata/python3/data
parent26c54d2a6be38b2d754f808f70b817fc8f4de6d1 (diff)
downloadastroid-git-b5e3e71068c8eeb0ee5bb7770e6e26d207b7b92e.tar.gz
Fix crash on inference of ``__dict__.items()`` of an imported module (#1367)
Diffstat (limited to 'tests/testdata/python3/data')
-rw-r--r--tests/testdata/python3/data/module_dict_items_call/models.py5
-rw-r--r--tests/testdata/python3/data/module_dict_items_call/test.py7
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/testdata/python3/data/module_dict_items_call/models.py b/tests/testdata/python3/data/module_dict_items_call/models.py
new file mode 100644
index 00000000..212bc011
--- /dev/null
+++ b/tests/testdata/python3/data/module_dict_items_call/models.py
@@ -0,0 +1,5 @@
+import re
+
+
+class MyModel:
+ class_attribute = 1
diff --git a/tests/testdata/python3/data/module_dict_items_call/test.py b/tests/testdata/python3/data/module_dict_items_call/test.py
new file mode 100644
index 00000000..4a52b18e
--- /dev/null
+++ b/tests/testdata/python3/data/module_dict_items_call/test.py
@@ -0,0 +1,7 @@
+import models
+
+
+def func():
+ for _, value in models.__dict__.items():
+ if isinstance(value, type):
+ value.class_attribute += 1