Skip to content

Commit 6e3fc5f

Browse files
committed
Fix typing errors after mypy update
1 parent 9ca47f3 commit 6e3fc5f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/pluggy/_hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def __init__(self, orig: _HookCaller, remove_plugins: AbstractSet[_Plugin]) -> N
501501
self._hookexec = orig._hookexec # type: ignore[misc]
502502

503503
@property # type: ignore[misc]
504-
def _hookimpls(self) -> List["HookImpl"]: # type: ignore[override]
504+
def _hookimpls(self) -> List["HookImpl"]:
505505
return [
506506
impl
507507
for impl in self._orig._hookimpls

src/pluggy/_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def parse_hookimpl_opts(
191191
res = {} # type: ignore[assignment]
192192
if res is not None and not isinstance(res, dict):
193193
# false positive
194-
res = None
194+
res = None # type:ignore[unreachable]
195195
return res
196196

197197
def unregister(

testing/test_pluginmanager.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
``PluginManager`` unit and public API testing.
33
"""
44
import pytest
5+
import sys
56
from typing import Any, List
67

78
from pluggy import (
@@ -11,7 +12,11 @@
1112
PluginManager,
1213
PluginValidationError,
1314
)
14-
from pluggy._manager import importlib_metadata
15+
16+
if sys.version_info >= (3, 8):
17+
from importlib import metadata as importlib_metadata
18+
else:
19+
import importlib_metadata
1520

1621

1722
hookspec = HookspecMarker("example")

0 commit comments

Comments
 (0)