diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-28 01:41:52 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-28 01:41:52 +0900 |
commit | 8c35cfa38a9cadddc48958d12218e66f7c799b31 (patch) | |
tree | 2e66103d7fd08337e6084bca92a465de625e2a4c /tests/test_util_typing.py | |
parent | 1c4a1ef87cf225d84b4f834b2b4ab64da12586ef (diff) | |
parent | 153682dd4c8a56d3becff70b0264df4c13b6eb41 (diff) | |
download | sphinx-git-8c35cfa38a9cadddc48958d12218e66f7c799b31.tar.gz |
Merge branch '3.0.x' into 3.x
Diffstat (limited to 'tests/test_util_typing.py')
-rw-r--r-- | tests/test_util_typing.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py index f6fd35fb0..41d2a19c2 100644 --- a/tests/test_util_typing.py +++ b/tests/test_util_typing.py @@ -10,7 +10,7 @@ import sys from numbers import Integral -from typing import Any, Dict, List, TypeVar, Union, Callable, Tuple, Optional +from typing import Any, Dict, List, TypeVar, Union, Callable, Tuple, Optional, Generic import pytest @@ -24,6 +24,11 @@ class MyClass1: class MyClass2(MyClass1): __qualname__ = '<MyClass2>' +T = TypeVar('T') + +class MyList(List[T]): + pass + def test_stringify(): assert stringify(int) == "int" @@ -42,6 +47,7 @@ def test_stringify_type_hints_containers(): assert stringify(Tuple[str, str, str]) == "Tuple[str, str, str]" assert stringify(Tuple[str, ...]) == "Tuple[str, ...]" assert stringify(List[Dict[str, Tuple]]) == "List[Dict[str, Tuple]]" + assert stringify(MyList[Tuple[int, int]]) == "test_util_typing.MyList[Tuple[int, int]]" @pytest.mark.skipif(sys.version_info < (3, 9), reason='python 3.9+ is required.') |