Skip to content

Commit 5cb9a16

Browse files
committed
Add test cases
1 parent a6b48f1 commit 5cb9a16

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

mypy/test/data/check-ignore.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,17 @@ x # E: Name 'x' is not defined
2828
x = 1
2929
x = '' # type: ignore
3030
x = '' # E: Incompatible types in assignment (expression has type "str", variable has type "int")
31+
32+
[case testIgnoreInvalidOverride]
33+
class A:
34+
def f(self) -> int: pass
35+
class B(A):
36+
def f(self) -> str: pass # type: ignore
37+
38+
[case testIgnoreMissingModuleAttribute]
39+
import m
40+
m.x = object # type: ignore
41+
m.f() # type: ignore
42+
m.y # E: "module" has no attribute "y"
43+
[file m.py]
44+
[builtins fixtures/module.py]

0 commit comments

Comments
 (0)