diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-08-22 21:38:00 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-08-30 19:49:58 +0200 |
commit | cc35589d1b6b12a88bb691d006e3cb0b81a4a9e5 (patch) | |
tree | 0980f6659e98ec9dc6e7415699b558e988655c9c | |
parent | ed73dd14eb46808e35efc75d81f6748fc9cfd62c (diff) | |
download | pylint-git-cc35589d1b6b12a88bb691d006e3cb0b81a4a9e5.tar.gz |
Add regression test for false positive on collections.abc
-rw-r--r-- | tests/functional/u/unpacking_non_sequence_py37.py | 15 | ||||
-rw-r--r-- | tests/functional/u/unpacking_non_sequence_py37.rc | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/functional/u/unpacking_non_sequence_py37.py b/tests/functional/u/unpacking_non_sequence_py37.py new file mode 100644 index 000000000..dd8af1136 --- /dev/null +++ b/tests/functional/u/unpacking_non_sequence_py37.py @@ -0,0 +1,15 @@ +# pylint: disable=missing-docstring + +# https://github.com/PyCQA/pylint/issues/4895 +from __future__ import annotations + +from collections.abc import Callable +from dataclasses import dataclass + + +@dataclass +class Metric: + function: Callable[..., tuple[int, int]] + + def update(self): + _, _ = self.function() diff --git a/tests/functional/u/unpacking_non_sequence_py37.rc b/tests/functional/u/unpacking_non_sequence_py37.rc new file mode 100644 index 000000000..a17bb22da --- /dev/null +++ b/tests/functional/u/unpacking_non_sequence_py37.rc @@ -0,0 +1,2 @@ +[testoptions] +min_pyver=3.7 |