Skip to content

Commit cb61a61

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 92781da commit cb61a61

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test-data/unit/daemon.test

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,42 @@ bar.py:2: error: "type: ignore" comment without error code [ignore-without-code
557557
from foo.empty import *
558558
a = 1 # type: ignore
559559

560+
[case testUnusedTypeIgnorePreservedAfterChange]
561+
-- Regression test for https://github.com/python/mypy/issues/9655
562+
$ dmypy start -- --warn-unused-ignores --no-error-summary
563+
Daemon started
564+
$ dmypy check -- bar.py
565+
bar.py:2: error: Unused "type: ignore" comment
566+
== Return code: 1
567+
$ echo '' >> bar.py
568+
$ dmypy check -- bar.py
569+
bar.py:2: error: Unused "type: ignore" comment
570+
== Return code: 1
571+
572+
[file foo/__init__.py]
573+
[file foo/empty.py]
574+
[file bar.py]
575+
from foo.empty import *
576+
a = 1 # type: ignore
577+
578+
[case testTypeIgnoreWithoutCodePreservedAfterChange]
579+
-- Regression test for https://github.com/python/mypy/issues/9655
580+
$ dmypy start -- --enable-error-code ignore-without-code --no-error-summary
581+
Daemon started
582+
$ dmypy check -- bar.py
583+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
584+
== Return code: 1
585+
$ echo '' >> bar.py
586+
$ dmypy check -- bar.py
587+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
588+
== Return code: 1
589+
590+
[file foo/__init__.py]
591+
[file foo/empty.py]
592+
[file bar.py]
593+
from foo.empty import *
594+
a = 1 # type: ignore
595+
560596
[case testPossiblyUndefinedVarsPreservedAfterUpdate]
561597
-- Regression test for https://github.com/python/mypy/issues/9655
562598
$ dmypy start -- --enable-error-code possibly-undefined --no-error-summary

0 commit comments

Comments
 (0)