Skip to content

Commit 8b62963

Browse files
add tests
1 parent 19d9d40 commit 8b62963

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test-data/unit/check-errorcodes.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,19 @@ def f() -> None:
394394
def g():
395395
pass
396396

397+
[case testErrorCodeUntypedDecorator]
398+
# flags: --disallow-untyped-decorators --warn-unused-ignores
399+
def d(f): return f
400+
401+
@d # E: Untyped decorator makes function "x" untyped [untyped-decorator]
402+
def x() -> int: return 1
403+
@d # type: ignore
404+
def y() -> int: return 2
405+
@d # type: ignore[untyped-decorator]
406+
def best() -> int: return 3
407+
@d # type: ignore[misc] # E: Unused "type: ignore" comment, use narrower [untyped-decorator] instead of [misc] code [unused-ignore]
408+
def z() -> int: return 4
409+
397410
[case testErrorCodeIndexing]
398411
from typing import Dict
399412
x: Dict[int, int]

0 commit comments

Comments
 (0)