summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2013-12-01 00:21:20 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2013-12-01 00:21:20 (GMT)
commit3c23e7a5dcbc1972bd9e26dc26e61d856abb51f1 (patch)
tree600903588902508759b5ad8e3cbeb9d4b8329c1c /Lib/test/pickletester.py
parent9204af42cc271690f57a4bc0d2af53201a796b51 (diff)
parent19b6fa6ebb887e498437b4ae87d6e70b92b4742b (diff)
downloadcpython-3c23e7a5dcbc1972bd9e26dc26e61d856abb51f1.zip
cpython-3c23e7a5dcbc1972bd9e26dc26e61d856abb51f1.tar.gz
cpython-3c23e7a5dcbc1972bd9e26dc26e61d856abb51f1.tar.bz2
Issue #6477: Merge with 3.3.
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 12b6c8f..999eab0 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -804,6 +804,15 @@ class AbstractPickleTests(unittest.TestCase):
u = self.loads(s)
self.assertIs(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):