diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-23 14:15:48 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-23 14:15:48 +0100 |
commit | bfc057fcb43946cd16d923e044e79185fb82d74c (patch) | |
tree | 4fc87bec24e23b9c964461087815f5af0c4e01e6 /Lib/test/test_marshal.py | |
parent | e07fab7215d2763de7bf6cd73aacf3fedcbf5464 (diff) | |
download | cpython-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.py | 7 |
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): |