Skip to content

Commit c0e4224

Browse files
committed
Some more types
1 parent 335369e commit c0e4224

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/sphinx_autodoc_typehints/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
*("GeneratorType", "GetSetDescriptorType"),
4646
"LambdaType",
4747
*("MemberDescriptorType", "MethodDescriptorType", "MethodType", "MethodWrapperType"),
48+
# NoneType is special, but included here for completeness' sake
4849
*("NoneType", "NotImplementedType"),
4950
"WrapperDescriptorType",
5051
}

tests/test_sphinx_autodoc_typehints.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from io import StringIO
1010
from pathlib import Path
1111
from textwrap import dedent, indent
12-
from types import FunctionType, ModuleType
12+
from types import EllipsisType, FrameType, FunctionType, ModuleType, NotImplementedType, TracebackType
1313
from typing import ( # noqa: UP035
1414
IO,
1515
Any,
@@ -168,8 +168,12 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
168168
pytest.param(str, ":py:class:`str`", id="str"),
169169
pytest.param(int, ":py:class:`int`", id="int"),
170170
pytest.param(StringIO, ":py:class:`~io.StringIO`", id="StringIO"),
171+
pytest.param(EllipsisType, ":py:data:`~types.EllipsisType`", id="EllipsisType"),
171172
pytest.param(FunctionType, ":py:data:`~types.FunctionType`", id="FunctionType"),
173+
pytest.param(FrameType, ":py:data:`~types.FrameType`", id="FrameType"),
172174
pytest.param(ModuleType, ":py:class:`~types.ModuleType`", id="ModuleType"),
175+
pytest.param(NotImplementedType, ":py:data:`~types.NotImplementedType`", id="NotImplementedType"),
176+
pytest.param(TracebackType, ":py:class:`~types.TracebackType`", id="TracebackType"),
173177
pytest.param(type(None), ":py:obj:`None`", id="type None"),
174178
pytest.param(type, ":py:class:`type`", id="type"),
175179
pytest.param(Callable, ":py:class:`~collections.abc.Callable`", id="abc-Callable"),

0 commit comments

Comments
 (0)