Skip to content

Commit e5b660f

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 python#9655. Ref: python#9655
1 parent 65dd67c commit e5b660f

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
@@ -632,3 +632,20 @@ bar.py:2: error: Unused "type: ignore" comment
632632
[file bar.py]
633633
from foo.empty import *
634634
a = 1 # type: ignore
635+
636+
[case testTypeIgnoreWithoutCodePreservedOnRerun]
637+
-- Regression test for https://github.com/python/mypy/issues/9655
638+
$ dmypy start -- --enable-error-code ignore-without-code --no-error-summary
639+
Daemon started
640+
$ dmypy check -- bar.py
641+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
642+
== Return code: 1
643+
$ dmypy check -- bar.py
644+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
645+
== Return code: 1
646+
647+
[file foo/__init__.py]
648+
[file foo/empty.py]
649+
[file bar.py]
650+
from foo.empty import *
651+
a = 1 # type: ignore

0 commit comments

Comments
 (0)