Skip to content

Commit c42c817

Browse files
add test case for misc silencing redefinition notes
this is found in mypy_primer's corpus, but wasn't in our local tests. This covers silencing associated notes
1 parent 3874155 commit c42c817

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test-data/unit/check-errorcodes.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ reveal_type(1) #type: ignore[misc] # N: Revealed type is "Literal[1]?"
1010
[case testErrorCodeMiscDoesntSuppressRevealLocals]
1111
reveal_locals() #type:ignore[misc] # N: There are no locals to reveal
1212

13+
[case testErrorCodeMiscRedefinitionNotes]
14+
# flags: --strict
15+
if x: #type: ignore[name-defined]
16+
def y() -> None: pass
17+
else:
18+
def y() -> bool: return True # type: ignore[misc]
19+
20+
1321
[case testErrorCodeNoAttribute]
1422
import m
1523
m.x # E: Module has no attribute "x" [attr-defined]

0 commit comments

Comments
 (0)