Skip to content

Commit 017ef61

Browse files
committed
Merge branch '4.4.x' into 4.x
2 parents 889eb99 + 838964b commit 017ef61

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/test_util_typing.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ def test_restify_type_hints_containers():
7070
"[:py:class:`str`, :py:class:`str`, "
7171
":py:class:`str`]")
7272
assert restify(Tuple[str, ...]) == ":py:class:`~typing.Tuple`\\ [:py:class:`str`, ...]"
73-
assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`\\ [()]"
73+
74+
if sys.version_info < (3, 11):
75+
assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`\\ [()]"
76+
else:
77+
assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`"
78+
7479
assert restify(List[Dict[str, Tuple]]) == (":py:class:`~typing.List`\\ "
7580
"[:py:class:`~typing.Dict`\\ "
7681
"[:py:class:`str`, :py:class:`~typing.Tuple`]]")
@@ -263,9 +268,14 @@ def test_stringify_type_hints_containers():
263268
assert stringify(Tuple[str, ...], "fully-qualified") == "typing.Tuple[str, ...]"
264269
assert stringify(Tuple[str, ...], "smart") == "~typing.Tuple[str, ...]"
265270

266-
assert stringify(Tuple[()]) == "Tuple[()]"
267-
assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple[()]"
268-
assert stringify(Tuple[()], "smart") == "~typing.Tuple[()]"
271+
if sys.version_info < (3, 11):
272+
assert stringify(Tuple[()]) == "Tuple[()]"
273+
assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple[()]"
274+
assert stringify(Tuple[()], "smart") == "~typing.Tuple[()]"
275+
else:
276+
assert stringify(Tuple[()]) == "Tuple"
277+
assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple"
278+
assert stringify(Tuple[()], "smart") == "~typing.Tuple"
269279

270280
assert stringify(List[Dict[str, Tuple]]) == "List[Dict[str, Tuple]]"
271281
assert stringify(List[Dict[str, Tuple]], "fully-qualified") == "typing.List[typing.Dict[str, typing.Tuple]]"

0 commit comments

Comments
 (0)