Skip to content

mypy 0.990 does not find any errors #142

@dmtucker

Description

@dmtucker

tox -e py310-pytest7.x-mypy0.9x is currently failing 15 tests:

15 failed, 32 passed, 6 xfailed, 18 warnings in 56.12s

(Warnings are pytest-dev/pytest-cov#561.)

This diff seems to fix it:

diff --git a/src/pytest_mypy.py b/src/pytest_mypy.py
index d067925..fd1ba4d 100644
--- a/src/pytest_mypy.py
+++ b/src/pytest_mypy.py
@@ -262,7 +262,9 @@ class MypyResults:
             os.path.abspath(str(item.fspath)): [] for item in items
         }  # type: MypyResults._abspath_errors_type
 
-        stdout, stderr, status = mypy.api.run(opts + list(abspath_errors))
+        stdout, stderr, status = mypy.api.run(
+            opts + list(os.path.relpath(key) for key in abspath_errors.keys())
+        )
 
         unmatched_lines = []
         for line in stdout.split("\n"):

Because of that, I suspect python/mypy#14042 is to blame.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions