Skip to content

Commit 496b33e

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 b4569fa commit 496b33e

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
@@ -539,3 +539,20 @@ bar.py:2: error: Unused "type: ignore" comment
539539
[file bar.py]
540540
from foo.empty import *
541541
a = 1 # type: ignore
542+
543+
[case testTypeIgnoreWithoutCodePreservedAfterUpdate]
544+
-- Regression test for https://github.com/python/mypy/issues/9655
545+
$ dmypy start -- --enable-error-code ignore-without-code --no-error-summary
546+
Daemon started
547+
$ dmypy check -- bar.py
548+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
549+
== Return code: 1
550+
$ dmypy check -- bar.py
551+
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
552+
== Return code: 1
553+
554+
[file foo/__init__.py]
555+
[file foo/empty.py]
556+
[file bar.py]
557+
from foo.empty import *
558+
a = "type ignore without a code" # type: ignore

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy