From 93a6a5e7a809c84fdc63ba74e498fd86b42c8953 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Sat, 14 Jan 2023 09:03:34 -0800 Subject: [PATCH] Fix tests --- tests/test_sphinx_autodoc_typehints.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_sphinx_autodoc_typehints.py b/tests/test_sphinx_autodoc_typehints.py index 73b3dcf7..373c9a01 100644 --- a/tests/test_sphinx_autodoc_typehints.py +++ b/tests/test_sphinx_autodoc_typehints.py @@ -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"), @@ -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`"),