@@ -76,6 +76,12 @@ def foo():
|
76 | 76 | |
77 | 77 | def bar(): |
78 | 78 | x = 1 # type: ignore |
| 79 | + |
| 80 | +def baz(): |
| 81 | + pass # type: ignore[excuse] |
| 82 | + pass # type: ignore=excuse |
| 83 | + pass # type: ignore [excuse] |
| 84 | + x = 1 # type: ignore whatever |
79 | 85 | """ |
80 | 86 | |
81 | 87 | # Test for long-form type-comments in arguments. A test function |
@@ -266,7 +272,7 @@ def test_vardecl(self):
|
266 | 272 | |
267 | 273 | def test_ignores(self): |
268 | 274 | for tree in self.parse_all(ignores): |
269 | | -self.assertEqual([ti.lineno for ti in tree.type_ignores], [2, 5]) |
| 275 | +self.assertEqual([ti.lineno for ti in tree.type_ignores], [2, 5, 8, 9, 10, 11]) |
270 | 276 | tree = self.classic_parse(ignores) |
271 | 277 | self.assertEqual(tree.type_ignores, []) |
272 | 278 | |
@@ -318,6 +324,7 @@ def check_both_ways(source):
|
318 | 324 | check_both_ways("while True:\n continue # type: int\n") |
319 | 325 | check_both_ways("try: # type: int\n pass\nfinally:\n pass\n") |
320 | 326 | check_both_ways("try:\n pass\nfinally: # type: int\n pass\n") |
| 327 | +check_both_ways("pass # type: ignorewhatever\n") |
321 | 328 | |
322 | 329 | def test_func_type_input(self): |
323 | 330 | |
|