Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Jan 14, 2023
1 parent 379b82a commit 0f43dc5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_sphinx_autodoc_typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def method(self: T) -> T:
pytest.param(Callable, "typing", "Callable", (), id="Callable"),
pytest.param(Callable[..., str], "typing", "Callable", (..., str), id="Callable_returntype"),
pytest.param(Callable[[int, str], str], "typing", "Callable", (int, str, str), id="Callable_all_types"),
pytest.param(collections.abc.Callable[[int, str], str], "collections.abc", "Callable", (int, str, str), id="collections.abc.Callable_all_types"),
pytest.param(Pattern, "typing", "Pattern", (), id="Pattern"),
pytest.param(Pattern[str], "typing", "Pattern", (str,), id="Pattern_parametrized"),
pytest.param(Match, "typing", "Match", (), id="Match"),
Expand Down Expand Up @@ -224,6 +225,10 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
":py:data:`~typing.Callable`\\[\\[:py:class:`~typing.TypeVar`\\(``T``)],"
" :py:class:`~typing.TypeVar`\\(``T``)]",
),
(
collections.abc.Callable[[int, str], bool],
":py:class:`~collections.abc.Callable`\\[\\[:py:class:`int`, " ":py:class:`str`], :py:class:`bool`]",
),
(Pattern, ":py:class:`~typing.Pattern`"),
(Pattern[str], ":py:class:`~typing.Pattern`\\[:py:class:`str`]"),
(IO, ":py:class:`~typing.IO`"),
Expand Down

0 comments on commit 0f43dc5

Please sign in to comment.