diff options
author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-11-12 17:29:14 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-11-12 16:39:35 +0100 |
commit | 850d1225f1666ab60c1d0b9d322a6683bc29dcdd (patch) | |
tree | e27ebe8c07a9f001ec8bd1f3b76468254fb9104a | |
parent | 57768ebbd7333035694d9f6bc3ad0be798572651 (diff) | |
download | pylint-git-850d1225f1666ab60c1d0b9d322a6683bc29dcdd.tar.gz |
Add tests for crash on inference of ``__len__``
-rw-r--r-- | tests/functional/r/regression_02/regression_5244.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/functional/r/regression_02/regression_5244.py b/tests/functional/r/regression_02/regression_5244.py new file mode 100644 index 000000000..ee5450679 --- /dev/null +++ b/tests/functional/r/regression_02/regression_5244.py @@ -0,0 +1,12 @@ +"""Test for the regression on inference of self referential __len__ +Reported in https://github.com/PyCQA/pylint/issues/5244 +""" +# pylint: disable=missing-class-docstring, missing-function-docstring, no-self-use + + +class MyClass: + def some_func(self): + return lambda: 42 + + def __len__(self): + return len(self.some_func()) |