Skip to content

Commit d2d8a49

Browse files
committed
Prove ignores without error codes also disappear
This test fails with the error: AssertionError: Command 3 (dmypy check -- bar.py) did not give expected output --- Captured stderr call --- Expected: bar.py:2: error: "type: ignore" comment without error code [ignore-without-code] (diff) == Return code: 1 (diff) Actual: (empty) This test illustrates that '"type: ignore" comment without error code' errors currently disappear in the same way that 'Unused "type: ignore"' errors do as described in #9655. Ref: #9655
1 parent aee1896 commit d2d8a49

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test-data/unit/daemon.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,3 +588,20 @@ bar.py:2: error: Unused "type: ignore" comment
588588
[file bar.py]
589589
from foo.empty import *
590590
a = 1 # type: ignore
591+
592+
[case testTypeIgnoreWithoutCodePreservedOnRerun]
593+
-- Regression test for https://github.com/python/mypy/issues/9655
594+
$ dmypy start -- --enable-error-code ignore-without-code --no-error-summary
595+
Daemon started
596+
$ dmypy check -- bar.py
597+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
598+
== Return code: 1
599+
$ dmypy check -- bar.py
600+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
601+
== Return code: 1
602+
603+
[file foo/__init__.py]
604+
[file foo/empty.py]
605+
[file bar.py]
606+
from foo.empty import *
607+
a = 1 # type: ignore

0 commit comments

Comments
 (0)