mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
bpo-44353: Improve tests covering typing.NewType pickling (GH-27302)
This commit is contained in:
parent
8072a1181d
commit
a22b05da87
1 changed files with 9 additions and 8 deletions
|
@ -3755,6 +3755,7 @@ class NewTypeTests:
|
|||
def test_pickle(self):
|
||||
UserAge = self.module.NewType('UserAge', float)
|
||||
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
with self.subTest(proto=proto):
|
||||
pickled = pickle.dumps(UserId, proto)
|
||||
loaded = pickle.loads(pickled)
|
||||
self.assertIs(loaded, UserId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue