summaryrefslogtreecommitdiff
path: root/Lib/test/test_marshal.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-01-23 14:15:48 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-01-23 14:15:48 +0100
commitbfc057fcb43946cd16d923e044e79185fb82d74c (patch)
tree4fc87bec24e23b9c964461087815f5af0c4e01e6 /Lib/test/test_marshal.py
parente07fab7215d2763de7bf6cd73aacf3fedcbf5464 (diff)
downloadcpython-bfc057fcb43946cd16d923e044e79185fb82d74c.tar.gz
Issue #26146: marshal.loads() now uses the empty frozenset singleton
Diffstat (limited to 'Lib/test/test_marshal.py')
-rw-r--r--Lib/test/test_marshal.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index c7def9a599..b378ffea00 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -135,6 +135,13 @@ class ContainerTestCase(unittest.TestCase, HelperMixin):
for constructor in (set, frozenset):
self.helper(constructor(self.d.keys()))
+ @support.cpython_only
+ def test_empty_frozenset_singleton(self):
+ # marshal.loads() must reuse the empty frozenset singleton
+ obj = frozenset()
+ obj2 = marshal.loads(marshal.dumps(obj))
+ self.assertIs(obj2, obj)
+
class BufferTestCase(unittest.TestCase, HelperMixin):