diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-03-19 16:56:54 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-03-19 16:56:54 +0300 |
commit | 017ef6118b4fe588140266ad6ff2393cbddd9137 (patch) | |
tree | 1f47850f9e36018851fae53c146b65c67f36c028 | |
parent | 889eb99bcd387395eb61d995bf932e9f8eeeb5ae (diff) | |
parent | 838964bd4925721eb92e0497a8ea5321458c6217 (diff) |
Merge branch '4.4.x' into 4.x
-rw-r--r-- | tests/test_util_typing.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py index af2e5285b..5aa558c82 100644 --- a/tests/test_util_typing.py +++ b/tests/test_util_typing.py @@ -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]]" |