summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2022-06-25 15:46:33 (GMT)
committerGitHub <noreply@github.com>2022-06-25 15:46:33 (GMT)
commit75cb3abc3bf10c7be3b374bfb4c060c36d251411 (patch)
treeea765a8484f2a5c7c993c0c369dc798a32212c39
parent6b865349aae47b90f9ef0b98f3fe3720c2f05601 (diff)
downloadcpython-75cb3abc3bf10c7be3b374bfb4c060c36d251411.zip
cpython-75cb3abc3bf10c7be3b374bfb4c060c36d251411.tar.gz
cpython-75cb3abc3bf10c7be3b374bfb4c060c36d251411.tar.bz2
gh-94245: Test pickling and copying of typing.Tuple[()] (GH-94259)
-rw-r--r--Lib/test/test_typing.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 3894ab4..6850b88 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -3288,7 +3288,8 @@ class GenericTests(BaseTestCase):
self.assertEqual(x.bar, 'abc')
self.assertEqual(x.__dict__, {'foo': 42, 'bar': 'abc'})
samples = [Any, Union, Tuple, Callable, ClassVar,
- Union[int, str], ClassVar[List], Tuple[int, ...], Callable[[str], bytes],
+ Union[int, str], ClassVar[List], Tuple[int, ...], Tuple[()],
+ Callable[[str], bytes],
typing.DefaultDict, typing.FrozenSet[int]]
for s in samples:
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
@@ -3306,7 +3307,8 @@ class GenericTests(BaseTestCase):
def test_copy_and_deepcopy(self):
T = TypeVar('T')
class Node(Generic[T]): ...
- things = [Union[T, int], Tuple[T, int], Callable[..., T], Callable[[int], int],
+ things = [Union[T, int], Tuple[T, int], Tuple[()],
+ Callable[..., T], Callable[[int], int],
Tuple[Any, Any], Node[T], Node[int], Node[Any], typing.Iterable[T],
typing.Iterable[Any], typing.Iterable[int], typing.Dict[int, str],
typing.Dict[T, Any], ClassVar[int], ClassVar[List[T]], Tuple['T', 'T'],