summaryrefslogtreecommitdiff
path: root/tests/functional
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-10-06 23:19:33 +0200
committerGitHub <noreply@github.com>2021-10-06 23:19:33 +0200
commit8843fc90ef9a8a81c6304fef89988c73730da332 (patch)
tree2eaee254ae121b4eb19d98933a4654bdb7ee5692 /tests/functional
parentf963868f6b46d31ef7ae1bd1196eafe50bc4bad7 (diff)
downloadpylint-git-8843fc90ef9a8a81c6304fef89988c73730da332.tar.gz
Fix return type checkers calls on ellipses functions (#5107)
Closes #4736
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/c/class_protocol_ellipsis.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/functional/c/class_protocol_ellipsis.py b/tests/functional/c/class_protocol_ellipsis.py
new file mode 100644
index 000000000..ef5d3b34e
--- /dev/null
+++ b/tests/functional/c/class_protocol_ellipsis.py
@@ -0,0 +1,44 @@
+""""Tests for return type checkers for protocol methods with ellipsis function body"""
+# pylint: disable=missing-class-docstring
+from typing import Any, Iterator
+
+
+class MyClass:
+ """The "invalid-*-returned" messages shouldn't be emitted for stub functions
+ Original issue: https://github.com/PyCQA/pylint/issues/4736"""
+
+ def __len__(self) -> int:
+ ...
+
+ def __hash__(self) -> int:
+ ...
+
+ def __index__(self) -> int:
+ ...
+
+ def __iter__(self) -> Iterator[Any]:
+ ...
+
+ def __bool__(self) -> bool:
+ ...
+
+ def __repr__(self) -> object:
+ ...
+
+ def __str__(self) -> str:
+ ...
+
+ def __bytes__(self) -> bytes:
+ ...
+
+ def __length_hint__(self) -> int:
+ ...
+
+ def __format__(self, format_spec: str) -> str:
+ ...
+
+ def __getnewargs__(self) -> tuple:
+ ...
+
+ def __getnewargs_ex__(self) -> tuple:
+ ...