summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorIan Stapleton Cordasco <graffatcolmingov@gmail.com>2020-05-08 09:23:22 -0500
committerGitHub <noreply@github.com>2020-05-08 09:23:22 -0500
commit90026afea11298f0450194ed44af0b659ff6fc91 (patch)
tree9a019c52de7814d7a5c63adebc2ab9e79378b92f /testsuite
parenta238201edd2883fcc0400df4a11cbb6fd5f6e5d7 (diff)
parent742228c05fdd0a63acda3a26976f6d4fec49342c (diff)
downloadpep8-90026afea11298f0450194ed44af0b659ff6fc91.tar.gz
Merge pull request #927 from asottile/allow_typing_one_liners_again
re-allow decorated one-liners
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/E30not.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/E30not.py b/testsuite/E30not.py
index a86b99e..9c33236 100644
--- a/testsuite/E30not.py
+++ b/testsuite/E30not.py
@@ -177,6 +177,32 @@ def foo():
# for no E30x being emitted.
def bar(): pass
def baz(): pass
+#: E704:8:1 E704:10:1
+from typing import overload
+from typing import Union
+
+
+# This emits the (ignored-by-default) E704, but here we're testing
+# for no E30x being emitted.
+@overload
+def f(x: int) -> int: ...
+@overload
+def f(x: str) -> str: ...
+
+
+def f(x: Union[int, str]) -> Union[int, str]:
+ return x
+#: E704:8:5 E704:10:5
+from typing import Protocol
+
+
+class C(Protocol):
+ # This emits the (ignored-by-default) E704, but here we're testing
+ # for no E30x being emitted.
+ @property
+ def f(self) -> int: ...
+ @property
+ def g(self) -> str: ...
#: Okay
#!python
# -*- coding: utf-8 -*-