summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-12-31 14:10:55 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-12-31 14:25:05 +0900
commitf1a051fdfc72a882012f399f99b65bbe7729cb1f (patch)
tree3a120c0c7c3a873e81673d35c918b5678d2ddf3c /tests
parenta1d501d876693653fcd47e8ffd6e10ca4c48ffb6 (diff)
downloadsphinx-git-f1a051fdfc72a882012f399f99b65bbe7729cb1f.tar.gz
Fix #8315: autodoc: Failed to resolve struct.Struct type annotation
The builtin module, ``struct.Struct`` does not have correct module name since Python 3.8. This allows to refer it automatically.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_util_typing.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py
index a2565f1e1..d167d3bb0 100644
--- a/tests/test_util_typing.py
+++ b/tests/test_util_typing.py
@@ -10,6 +10,7 @@
import sys
from numbers import Integral
+from struct import Struct
from typing import (Any, Callable, Dict, Generator, List, NewType, Optional, Tuple, TypeVar,
Union)
@@ -43,6 +44,7 @@ def test_restify():
assert restify(str) == ":class:`str`"
assert restify(None) == ":obj:`None`"
assert restify(Integral) == ":class:`numbers.Integral`"
+ assert restify(Struct) == ":class:`struct.Struct`"
assert restify(Any) == ":obj:`Any`"
@@ -124,6 +126,7 @@ def test_stringify():
assert stringify(str) == "str"
assert stringify(None) == "None"
assert stringify(Integral) == "numbers.Integral"
+ assert restify(Struct) == ":class:`struct.Struct`"
assert stringify(Any) == "Any"