summaryrefslogtreecommitdiff
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 86869e18e1..86d668ef6f 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -768,6 +768,15 @@ class AbstractPickleTests(unittest.TestCase):
u = self.loads(s)
self.assertEqual(NotImplemented, u)
+ def test_singleton_types(self):
+ # Issue #6477: Test that types of built-in singletons can be pickled.
+ singletons = [None, ..., NotImplemented]
+ for singleton in singletons:
+ for proto in protocols:
+ s = self.dumps(type(singleton), proto)
+ u = self.loads(s)
+ self.assertIs(type(singleton), u)
+
# Tests for protocol 2
def test_proto(self):