diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-09-12 16:56:34 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-09-12 16:56:34 +0900 |
commit | 3d8fbd992cedf1784b106cf43ecbc452953ebe17 (patch) | |
tree | 4ec09892ce7a82728a3b8c857b34cb9920854f37 /tests/test_util_typing.py | |
parent | b8b804142903d019b4e222cb85463190cf1978ac (diff) | |
parent | ba2439a105e5a68a44dd3f839e86332889cce451 (diff) | |
download | sphinx-git-3d8fbd992cedf1784b106cf43ecbc452953ebe17.tar.gz |
Merge branch '4.x'
Diffstat (limited to 'tests/test_util_typing.py')
-rw-r--r-- | tests/test_util_typing.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py index 9cb1d61ef..bbee68f82 100644 --- a/tests/test_util_typing.py +++ b/tests/test_util_typing.py @@ -113,7 +113,11 @@ def test_restify_type_hints_typevars(): assert restify(T_co) == ":obj:`tests.test_util_typing.T_co`" assert restify(T_contra) == ":obj:`tests.test_util_typing.T_contra`" assert restify(List[T]) == ":class:`~typing.List`\\ [:obj:`tests.test_util_typing.T`]" - assert restify(MyInt) == ":class:`MyInt`" + + if sys.version_info >= (3, 10): + assert restify(MyInt) == ":class:`tests.test_util_typing.MyInt`" + else: + assert restify(MyInt) == ":class:`MyInt`" def test_restify_type_hints_custom_class(): @@ -250,7 +254,10 @@ def test_stringify_type_hints_typevars(): assert stringify(T_contra) == "tests.test_util_typing.T_contra" assert stringify(List[T]) == "List[tests.test_util_typing.T]" - assert stringify(MyInt) == "MyInt" + if sys.version_info >= (3, 10): + assert stringify(MyInt) == "tests.test_util_typing.MyInt" + else: + assert stringify(MyInt) == "MyInt" def test_stringify_type_hints_custom_class(): |