Skip to content

some tests with approved stubs have the wrong error #12504

@DetachHead

Description

@DetachHead

for example, the testLimitLegacyStubErrorVolume test:

[case testLimitLegacyStubErrorVolume]
# flags: --disallow-any-expr --soft-error-limit=5
import certifi # E: Cannot find implementation or library stub for module named "certifi" \
# N: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

since certifi is an approved stub, it should instead suggest installing them, like it does here:

>mypy -c "import certifi"
<string>:1: error: Library stubs not installed for "certifi" (or incompatible with Python 3.10)  [import]
<string>:1: note: Hint: "python3 -m pip install types-certifi"
<string>:1: note: (or run "mypy --install-types" to install all missing stub packages)
<string>:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

but for some reason, these tests (and also the playground) don't do that

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions