Skip to content

Commit

Permalink
Add support for mypy-0.990
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtucker committed Nov 9, 2022
1 parent 5cc71fd commit f0f3c97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/pytest_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ def from_mypy(
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 + [os.path.relpath(key) for key in abspath_errors.keys()]
)

unmatched_lines = []
for line in stdout.split("\n"):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pytest_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def pyfunc(x):
""",
)
result = testdir.runpytest_subprocess("--mypy", *xdist_args)
result.stdout.fnmatch_lines(["1: error: Function is missing a type annotation"])
result.stdout.fnmatch_lines(["1: error: Function is missing a type annotation*"])
assert result.ret != 0


Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ deps =
mypy0.95: mypy >= 0.950, < 0.960
mypy0.96: mypy >= 0.960, < 0.970
mypy0.97: mypy >= 0.970, < 0.980
mypy0.98: mypy >= 0.980, < 0.990
mypy0.99: mypy >= 0.990, <= 0.999
mypy0.9x: mypy >= 0.900, <= 0.999

packaging ~= 21.3
Expand Down

0 comments on commit f0f3c97

Please sign in to comment.