Skip to content

Commit 19e5ccf

Browse files
committed
Add testing of positive cases
1 parent f113c4a commit 19e5ccf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test-data/unit/check-errorcodes.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ x # type: ignore[name-defined, attr-defined] # E: Unused "type: ignore[attr-defi
139139
# flags: --warn-ignores-without-codes
140140
"x" # type: ignore # E: "type: ignore" comment without error code [ignore-without-code]
141141
y # type: ignore # E: "type: ignore" comment without error code (hint: add [name-defined]) [ignore-without-code]
142+
z # type: ignore[name-defined]
143+
"a" # type: ignore[ignore-without-code]
142144

143145
[case testErrorCodeMissingDoesntTrampleUnusedIgnoresWarning]
144146
# flags: --warn-ignores-without-codes --warn-unused-ignores
145147
"x" # type: ignore # E: Unused "type: ignore" comment
148+
"y" # type: ignore[ignore-without-code] # E: Unused "type: ignore" comment
149+
z # type: ignore[ignore-without-code] # E: Unused "type: ignore" comment # E: Name "z" is not defined [name-defined]
146150

147151
[case testErrorCodeMissingWholeFileIgnores]
148152
# flags: --warn-ignores-without-codes

0 commit comments

Comments
 (0)