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

Fix compatibility with pytest 7.2 #106

Merged
merged 1 commit into from Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions 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

Expand Down
4 changes: 2 additions & 2 deletions pytest_mypy_plugins/collect.py
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down