mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #6477: Merge with 3.3.
This commit is contained in:
commit
3c23e7a5dc
6 changed files with 58 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue