Skip to content

Commit 9e3c6b4

Browse files
committed
Require Pytest 7+
1 parent 00ad341 commit 9e3c6b4

File tree

3 files changed

+13
-29
lines changed

3 files changed

+13
-29
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies = [
3333
"attrs>=19.0",
3434
"filelock>=3.0",
3535
"mypy>=1.0",
36-
"pytest>=6.0",
36+
"pytest>=7.0",
3737
]
3838

3939
[project.entry-points.pytest11]

src/pytest_mypy.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import pytest
1414

1515

16-
PYTEST_MAJOR_VERSION = int(pytest.__version__.partition(".")[0])
1716
mypy_argv = []
1817
nodeid_name = "mypy"
1918
terminal_summary_title = "mypy"
@@ -126,18 +125,6 @@ def pytest_collect_file(file_path, parent):
126125
return None
127126

128127

129-
if PYTEST_MAJOR_VERSION < 7: # pragma: no cover
130-
_pytest_collect_file = pytest_collect_file
131-
132-
def pytest_collect_file(path, parent): # type: ignore
133-
try:
134-
# https://docs.pytest.org/en/7.0.x/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path
135-
return _pytest_collect_file(Path(str(path)), parent)
136-
except TypeError:
137-
# https://docs.pytest.org/en/7.0.x/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
138-
return MypyFile.from_parent(parent=parent, fspath=path)
139-
140-
141128
class MypyFile(pytest.File):
142129
"""A File that Mypy will run on."""
143130

tox.ini

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,27 @@
33
minversion = 4.4
44
isolated_build = true
55
envlist =
6-
py37-pytest{6.0, 6.x, 7.0, 7.x}-mypy{1.0, 1.x}
7-
py38-pytest{6.0, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
8-
py39-pytest{6.0, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
9-
py310-pytest{6.2, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
10-
py311-pytest{6.2, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
11-
py312-pytest{6.2, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
6+
py37-pytest{7.0, 7.x}-mypy{1.0, 1.x}
7+
py38-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
8+
py39-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
9+
py310-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
10+
py311-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
11+
py312-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
1212
publish
1313
static
1414

1515
[gh-actions]
1616
python =
17-
3.7: py37-pytest{6.0, 6.x, 7.0, 7.x}-mypy{1.0, 1.x}
18-
3.8: py38-pytest{6.0, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}, publish, static
19-
3.9: py39-pytest{6.0, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
20-
3.10: py310-pytest{6.2, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
21-
3.11: py311-pytest{6.2, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
22-
3.12: py312-pytest{6.2, 6.x, 7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
17+
3.7: py37-pytest{7.0, 7.x}-mypy{1.0, 1.x}
18+
3.8: py38-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}, publish, static
19+
3.9: py39-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
20+
3.10: py310-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
21+
3.11: py311-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
22+
3.12: py312-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}
2323

2424
[testenv]
2525
constrain_package_deps = true
2626
deps =
27-
pytest6.0: pytest ~= 6.0.0
28-
pytest6.2: pytest ~= 6.2.0
29-
pytest6.x: pytest ~= 6.0
3027
pytest7.0: pytest ~= 7.0.0
3128
pytest7.x: pytest ~= 7.0
3229
pytest8.0: pytest ~= 8.0.0

0 commit comments

Comments
 (0)