mirror of
https://github.com/python/cpython.git
synced 2025-11-08 09:32:01 +00:00
[3.14] gh-136285: Improve pickle protocol testing in test_interpreters (GH-136286) (#136333)
gh-136285: Improve `pickle` protocol testing in `test_interpreters` (GH-136286)
(cherry picked from commit 06e347b846)
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
2b2cf81a6c
commit
d86ca7b610
7 changed files with 28 additions and 30 deletions
|
|
@ -412,9 +412,11 @@ def test_equality(self):
|
|||
|
||||
def test_pickle(self):
|
||||
interp = interpreters.create()
|
||||
data = pickle.dumps(interp)
|
||||
unpickled = pickle.loads(data)
|
||||
self.assertEqual(unpickled, interp)
|
||||
for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
with self.subTest(protocol=protocol):
|
||||
data = pickle.dumps(interp, protocol)
|
||||
unpickled = pickle.loads(data)
|
||||
self.assertEqual(unpickled, interp)
|
||||
|
||||
|
||||
class TestInterpreterIsRunning(TestBase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue