Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/test_typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def test_cannot_instantiate(self):
type(self.bottom_type)()

def test_pickle(self):
for proto in range(pickle.HIGHEST_PROTOCOL):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
pickled = pickle.dumps(self.bottom_type, protocol=proto)
self.assertIs(self.bottom_type, pickle.loads(pickled))

Expand Down Expand Up @@ -5904,7 +5904,7 @@ def test_pickle(self):
P_co = ParamSpec('P_co', covariant=True)
P_contra = ParamSpec('P_contra', contravariant=True)
P_default = ParamSpec('P_default', default=[int])
for proto in range(pickle.HIGHEST_PROTOCOL):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
with self.subTest(f'Pickle protocol {proto}'):
for paramspec in (P, P_co, P_contra, P_default):
z = pickle.loads(pickle.dumps(paramspec, proto))
Expand Down Expand Up @@ -6327,7 +6327,7 @@ def test_typevar(self):
self.assertIs(StrT.__bound__, LiteralString)

def test_pickle(self):
for proto in range(pickle.HIGHEST_PROTOCOL):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
pickled = pickle.dumps(LiteralString, protocol=proto)
self.assertIs(LiteralString, pickle.loads(pickled))

Expand Down Expand Up @@ -6374,7 +6374,7 @@ def return_tuple(self) -> TupleSelf:
return (self, self)

def test_pickle(self):
for proto in range(pickle.HIGHEST_PROTOCOL):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
pickled = pickle.dumps(Self, protocol=proto)
self.assertIs(Self, pickle.loads(pickled))

Expand Down Expand Up @@ -6586,7 +6586,7 @@ def test_pickle(self):
Ts = TypeVarTuple('Ts')
Ts_default = TypeVarTuple('Ts_default', default=Unpack[Tuple[int, str]])

for proto in range(pickle.HIGHEST_PROTOCOL):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
for typevartuple in (Ts, Ts_default):
z = pickle.loads(pickle.dumps(typevartuple, proto))
self.assertEqual(z.__name__, typevartuple.__name__)
Expand Down Expand Up @@ -7597,7 +7597,7 @@ def test_pickle(self):
U_co = typing_extensions.TypeVar('U_co', covariant=True)
U_contra = typing_extensions.TypeVar('U_contra', contravariant=True)
U_default = typing_extensions.TypeVar('U_default', default=int)
for proto in range(pickle.HIGHEST_PROTOCOL):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
for typevar in (U, U_co, U_contra, U_default):
z = pickle.loads(pickle.dumps(typevar, proto))
self.assertEqual(z.__name__, typevar.__name__)
Expand Down Expand Up @@ -7746,7 +7746,7 @@ def test_pickle(self):
global U, U_infer # pickle wants to reference the class by name
U = typing_extensions.TypeVar('U')
U_infer = typing_extensions.TypeVar('U_infer', infer_variance=True)
for proto in range(pickle.HIGHEST_PROTOCOL):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
for typevar in (U, U_infer):
z = pickle.loads(pickle.dumps(typevar, proto))
self.assertEqual(z.__name__, typevar.__name__)
Expand Down Expand Up @@ -8351,7 +8351,7 @@ def test_equality(self):

def test_pickle(self):
doc_info = Doc("Who to say hi to")
for proto in range(pickle.HIGHEST_PROTOCOL):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
pickled = pickle.dumps(doc_info, protocol=proto)
self.assertEqual(doc_info, pickle.loads(pickled))

Expand Down
Loading