summaryrefslogtreecommitdiff
path: root/Lib/test
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
commit1aa78938b0d019b7c9cbb153c2f35709ee01a19a (patch)
treed6402b7773cb2a98e0ab6efccd997707007045d7 /Lib/test
parent5ebe2c89fe47501db64e1a82ac6a3bcbd21f6e70 (diff)
downloadcpython-git-1aa78938b0d019b7c9cbb153c2f35709ee01a19a.tar.gz
Issue #26146: marshal.loads() now uses the empty frozenset singleton
Diffstat (limited to 'Lib/test')
-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):