summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_interpreters/test_api.py
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2024-03-05 15:54:46 (GMT)
committerGitHub <noreply@github.com>2024-03-05 15:54:46 (GMT)
commit4402b3cbcf8323bfa908ef86a687a5a7d46d27f3 (patch)
treed14e09be12129a9548655a6ca14d6279ee5081b6 /Lib/test/test_interpreters/test_api.py
parentbdba8ef42b15e651dc23374a08143cc2b4c4657d (diff)
downloadcpython-4402b3cbcf8323bfa908ef86a687a5a7d46d27f3.zip
cpython-4402b3cbcf8323bfa908ef86a687a5a7d46d27f3.tar.gz
cpython-4402b3cbcf8323bfa908ef86a687a5a7d46d27f3.tar.bz2
gh-76785: Minor Improvements to "interpreters" Module (gh-116328)
This includes adding pickle support to various classes, and small changes to improve the maintainability of the low-level _xxinterpqueues module.
Diffstat (limited to 'Lib/test/test_interpreters/test_api.py')
-rw-r--r--Lib/test/test_interpreters/test_api.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_interpreters/test_api.py b/Lib/test/test_interpreters/test_api.py
index 363143f..3cde9bd 100644
--- a/Lib/test/test_interpreters/test_api.py
+++ b/Lib/test/test_interpreters/test_api.py
@@ -1,4 +1,5 @@
import os
+import pickle
import threading
from textwrap import dedent
import unittest
@@ -261,6 +262,12 @@ class InterpreterObjectTests(TestBase):
self.assertEqual(interp1, interp1)
self.assertNotEqual(interp1, interp2)
+ def test_pickle(self):
+ interp = interpreters.create()
+ data = pickle.dumps(interp)
+ unpickled = pickle.loads(data)
+ self.assertEqual(unpickled, interp)
+
class TestInterpreterIsRunning(TestBase):