Skip to content
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

mypy 0.990 does not find any errors #142

Closed
dmtucker opened this issue Nov 9, 2022 · 0 comments · Fixed by #143
Closed

mypy 0.990 does not find any errors #142

dmtucker opened this issue Nov 9, 2022 · 0 comments · Fixed by #143

Comments

@dmtucker
Copy link
Collaborator

dmtucker commented Nov 9, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant