Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2022-03-19 11:10:12 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2022-03-19 11:10:13 +0300
commit2f85b1a4024d99b58705a74a179635b5bd0571b8 (patch)
tree1464ac6ee084654368f74ac3c887f3e0560a3b00
parentce5537c980bf28fa44944aeeab68a3c80fd85762 (diff)
test: empty tuple type is now repesented w/o args since py3.11
refs: https://github.com/python/cpython/commit/15df8f8d89a0e563bdd15e4cd6734298736a5a1d
-rw-r--r--tests/test_util_typing.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py
index c061fa085..86fccb391 100644
--- a/tests/test_util_typing.py
+++ b/tests/test_util_typing.py
@@ -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`, ...]"
- 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`]]")
@@ -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, ...]"
- 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]]"