We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e580534 commit 2ba8fd5Copy full SHA for 2ba8fd5
changelog/9906.trivial.rst
@@ -0,0 +1 @@
1
+Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers.
src/_pytest/compat.py
@@ -50,9 +50,11 @@ class NotSetType(enum.Enum):
50
# fmt: on
51
52
if sys.version_info >= (3, 8):
53
- from importlib import metadata as importlib_metadata
+ import importlib.metadata
54
+
55
+ importlib_metadata = importlib.metadata
56
else:
- import importlib_metadata # noqa: F401
57
+ import importlib_metadata as importlib_metadata # noqa: F401
58
59
60
def _format_args(func: Callable[..., Any]) -> str:
0 commit comments