From f0f3c97f78ee6ece69d8e79648f53cda70930c3d Mon Sep 17 00:00:00 2001 From: David Tucker Date: Tue, 8 Nov 2022 20:08:53 -0800 Subject: [PATCH] Add support for mypy-0.990 --- src/pytest_mypy.py | 4 +++- tests/test_pytest_mypy.py | 2 +- tox.ini | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pytest_mypy.py b/src/pytest_mypy.py index d067925..668e9f1 100644 --- a/src/pytest_mypy.py +++ b/src/pytest_mypy.py @@ -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"): diff --git a/tests/test_pytest_mypy.py b/tests/test_pytest_mypy.py index 60c07f5..cf19112 100644 --- a/tests/test_pytest_mypy.py +++ b/tests/test_pytest_mypy.py @@ -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 diff --git a/tox.ini b/tox.ini index f350900..627d2d0 100644 --- a/tox.ini +++ b/tox.ini @@ -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