From 9e42358ef387d03bad38f59df3dbc19b36183227 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 12 Aug 2021 08:52:28 -0400 Subject: [PATCH] Move the test out of doctest. Still doesn't capture failure. --- importlib_metadata/_meta.py | 4 ---- tests/test_meta.py | 9 +++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 tests/test_meta.py diff --git a/importlib_metadata/_meta.py b/importlib_metadata/_meta.py index 5db31103..dd68c429 100644 --- a/importlib_metadata/_meta.py +++ b/importlib_metadata/_meta.py @@ -33,10 +33,6 @@ def json(self) -> Dict[str, Union[str, List[str]]]: class SimplePath(Protocol): """ A minimal subset of pathlib.Path required by PathDistribution. - - >>> import pathlib - >>> import typing - >>> _: SimplePath = typing.cast(pathlib.Path, None) """ def joinpath(self) -> 'SimplePath': diff --git a/tests/test_meta.py b/tests/test_meta.py new file mode 100644 index 00000000..050f4a12 --- /dev/null +++ b/tests/test_meta.py @@ -0,0 +1,9 @@ +import typing +import pathlib + +from importlib_metadata import _meta + + +class TestSimplePath: + def test_cast_from_Path(self): + _: _meta.SimplePath = typing.cast(pathlib.Path, None)