diff options
| author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-02-08 22:13:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-08 22:13:21 +0100 |
| commit | b5e3e71068c8eeb0ee5bb7770e6e26d207b7b92e (patch) | |
| tree | c2ea8ccbec6605a160bd126a254c6360c229819a /tests/testdata/python3/data | |
| parent | 26c54d2a6be38b2d754f808f70b817fc8f4de6d1 (diff) | |
| download | astroid-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.py | 5 | ||||
| -rw-r--r-- | tests/testdata/python3/data/module_dict_items_call/test.py | 7 |
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 |
