summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2020-04-27 20:55:02 -0700
committerAnthony Sottile <asottile@umich.edu>2020-04-27 20:55:02 -0700
commit742228c05fdd0a63acda3a26976f6d4fec49342c (patch)
treee279bfc0de0b2f236795a4b905adef04206337fa /testsuite
parent99f354dd37c872e457c0da27924c0ec95b8adffb (diff)
downloadpep8-742228c05fdd0a63acda3a26976f6d4fec49342c.tar.gz
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 -*-