Re-export importlib.metadata from _pytest.compat (#9906)

I'm fixing a bug in mypy's --no-implicit-reexport logic in
https://github.com/python/mypy/pull/12704 and mypy-primer flagged this
This commit is contained in:
Shantanu 2022-05-01 01:05:41 -06:00 committed by GitHub
parent e580534df0
commit 2ba8fd5bc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1 @@
Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers.

View File

@ -50,9 +50,11 @@ NOTSET: "Final" = NotSetType.token # noqa: E305
# fmt: on
if sys.version_info >= (3, 8):
from importlib import metadata as importlib_metadata
import importlib.metadata
importlib_metadata = importlib.metadata
else:
import importlib_metadata # noqa: F401
import importlib_metadata as importlib_metadata # noqa: F401
def _format_args(func: Callable[..., Any]) -> str: