Skip to content

More cases showing errors disappearing from dmypy reruns #15049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add failing tests showing disappearing errors
This shows two cases where errors disappear from the second run of
dmypy.

The first shows a way that "unused type ignore" errors can disappear.
The case is a little complicated, but I can't yet work out how to make
it smaller.

The second case shows how "module X has not attribute Y" errors
can disappear.
  • Loading branch information
meshy committed Apr 13, 2023
commit bf9ea4144548e5a626e167663ec1637ef72e038f
39 changes: 39 additions & 0 deletions test-data/unit/daemon.test
Original file line number Diff line number Diff line change
Expand Up @@ -611,3 +611,42 @@ from foo.empty import *
if False:
a = 1
a

[case testUnusedTypeIgnorePreservedOnRerunWithIgnoredMissingImports]
$ dmypy start -- --no-error-summary --ignore-missing-imports --warn-unused-ignores
Daemon started
$ dmypy check foo
foo/main.py:3: error: Unused "type: ignore" comment
== Return code: 1
$ dmypy check foo
foo/main.py:3: error: Unused "type: ignore" comment
== Return code: 1

[file unused/__init__.py]
[file unused/submodule.py]
[file foo/empty.py]
[file foo/__init__.py]
from foo.main import *
from unused.submodule import *
[file foo/main.py]
from foo import empty
from foo.does_not_exist import *
a = 1 # type: ignore

[case testModuleDoesNotExistPreservedOnRerun]
$ dmypy start -- --no-error-summary --ignore-missing-imports
Daemon started
$ dmypy check foo
foo/main.py:1: error: Module "foo" has no attribute "does_not_exist" [attr-defined]
== Return code: 1
$ dmypy check foo
foo/main.py:1: error: Module "foo" has no attribute "does_not_exist" [attr-defined]
== Return code: 1

[file unused/__init__.py]
[file unused/submodule.py]
[file foo/__init__.py]
from foo.main import *
[file foo/main.py]
from foo import does_not_exist
from unused.submodule import *
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