Skip to content

Commit 4c6bc13

Browse files
committed
Test run-running dmypy after a file is altered
These tests show how some errors disappear on a re-run of dmypy after a file is altered.
1 parent 437c90f commit 4c6bc13

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

test-data/unit/daemon.test

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ class B:
574574

575575
[case testUnusedTypeIgnorePreservedOnRerun]
576576
-- Regression test for https://github.com/python/mypy/issues/9655
577-
$ dmypy start -- --warn-unused-ignores --no-error-summary
577+
$ dmypy start -- --warn-unused-ignores --no-error-summary --hide-error-codes
578578
Daemon started
579579
$ dmypy check -- bar.py
580580
bar.py:2: error: Unused "type: ignore" comment
@@ -606,6 +606,42 @@ bar.py:2: error: "type: ignore" comment without error code [ignore-without-code
606606
from foo.empty import *
607607
a = 1 # type: ignore
608608

609+
[case testUnusedTypeIgnorePreservedAfterChange]
610+
-- Regression test for https://github.com/python/mypy/issues/9655
611+
$ dmypy start -- --warn-unused-ignores --no-error-summary --hide-error-codes
612+
Daemon started
613+
$ dmypy check -- bar.py
614+
bar.py:2: error: Unused "type: ignore" comment
615+
== Return code: 1
616+
$ echo '' >> bar.py
617+
$ dmypy check -- bar.py
618+
bar.py:2: error: Unused "type: ignore" comment
619+
== Return code: 1
620+
621+
[file foo/__init__.py]
622+
[file foo/empty.py]
623+
[file bar.py]
624+
from foo.empty import *
625+
a = 1 # type: ignore
626+
627+
[case testTypeIgnoreWithoutCodePreservedAfterChange]
628+
-- Regression test for https://github.com/python/mypy/issues/9655
629+
$ dmypy start -- --enable-error-code ignore-without-code --no-error-summary
630+
Daemon started
631+
$ dmypy check -- bar.py
632+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
633+
== Return code: 1
634+
$ echo '' >> bar.py
635+
$ dmypy check -- bar.py
636+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
637+
== Return code: 1
638+
639+
[file foo/__init__.py]
640+
[file foo/empty.py]
641+
[file bar.py]
642+
from foo.empty import *
643+
a = 1 # type: ignore
644+
609645
[case testPossiblyUndefinedVarsPreservedAfterUpdate]
610646
-- Regression test for https://github.com/python/mypy/issues/9655
611647
$ dmypy start -- --enable-error-code possibly-undefined --no-error-summary

0 commit comments

Comments
 (0)