mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '4.4.x' into 4.x
This commit is contained in:
commit
017ef6118b
@ -70,7 +70,12 @@ def test_restify_type_hints_containers():
|
||||
"[:py:class:`str`, :py:class:`str`, "
|
||||
":py:class:`str`]")
|
||||
assert restify(Tuple[str, ...]) == ":py:class:`~typing.Tuple`\\ [:py:class:`str`, ...]"
|
||||
assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`\\ [()]"
|
||||
|
||||
if sys.version_info < (3, 11):
|
||||
assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`\\ [()]"
|
||||
else:
|
||||
assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`"
|
||||
|
||||
assert restify(List[Dict[str, Tuple]]) == (":py:class:`~typing.List`\\ "
|
||||
"[:py:class:`~typing.Dict`\\ "
|
||||
"[:py:class:`str`, :py:class:`~typing.Tuple`]]")
|
||||
@ -263,9 +268,14 @@ def test_stringify_type_hints_containers():
|
||||
assert stringify(Tuple[str, ...], "fully-qualified") == "typing.Tuple[str, ...]"
|
||||
assert stringify(Tuple[str, ...], "smart") == "~typing.Tuple[str, ...]"
|
||||
|
||||
assert stringify(Tuple[()]) == "Tuple[()]"
|
||||
assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple[()]"
|
||||
assert stringify(Tuple[()], "smart") == "~typing.Tuple[()]"
|
||||
if sys.version_info < (3, 11):
|
||||
assert stringify(Tuple[()]) == "Tuple[()]"
|
||||
assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple[()]"
|
||||
assert stringify(Tuple[()], "smart") == "~typing.Tuple[()]"
|
||||
else:
|
||||
assert stringify(Tuple[()]) == "Tuple"
|
||||
assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple"
|
||||
assert stringify(Tuple[()], "smart") == "~typing.Tuple"
|
||||
|
||||
assert stringify(List[Dict[str, Tuple]]) == "List[Dict[str, Tuple]]"
|
||||
assert stringify(List[Dict[str, Tuple]], "fully-qualified") == "typing.List[typing.Dict[str, typing.Tuple]]"
|
||||
|
Loading…
Reference in New Issue
Block a user