diff --git a/CHANGELOG.md b/CHANGELOG.md index a4b01a5..be0fd68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Version history +## Version 1.10.1 + +### Bugfixes + +- Fixes compatibility with pytest 7.2, broken due to a private import from + `py._path`. ## Version 1.10.0 diff --git a/pytest_mypy_plugins/collect.py b/pytest_mypy_plugins/collect.py index a8ad8a0..637049d 100644 --- a/pytest_mypy_plugins/collect.py +++ b/pytest_mypy_plugins/collect.py @@ -6,11 +6,11 @@ from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Mapping, Optional, Set import pkg_resources +import py.path import pytest import yaml from _pytest.config.argparsing import Parser from _pytest.nodes import Node -from py._path.local import LocalPath from pytest_mypy_plugins import utils @@ -151,7 +151,7 @@ def pytest_collect_file(file_path: pathlib.Path, parent: Node) -> Optional[YamlT else: - def pytest_collect_file(path: LocalPath, parent: Node) -> Optional[YamlTestFile]: # type: ignore[misc] + def pytest_collect_file(path: py.path.local, parent: Node) -> Optional[YamlTestFile]: # type: ignore[misc] if path.ext in {".yaml", ".yml"} and path.basename.startswith(("test-", "test_")): return YamlTestFile.from_parent(parent, fspath=path) return None