mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
test: empty tuple type is now repesented w/o args since py3.11
refs: 15df8f8d89
This commit is contained in:
parent
ce5537c980
commit
2f85b1a402
@ -78,7 +78,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`, ...]"
|
||||
|
||||
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`]]")
|
||||
@ -270,9 +275,14 @@ def test_stringify_type_hints_containers():
|
||||
assert stringify(Tuple[str, ...], "fully-qualified") == "typing.Tuple[str, ...]"
|
||||
assert stringify(Tuple[str, ...], "smart") == "~typing.Tuple[str, ...]"
|
||||
|
||||
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