diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-23 13:15:48 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-23 13:15:48 (GMT) |
| commit | 1aa78938b0d019b7c9cbb153c2f35709ee01a19a (patch) | |
| tree | d6402b7773cb2a98e0ab6efccd997707007045d7 /Lib/test/test_marshal.py | |
| parent | 5ebe2c89fe47501db64e1a82ac6a3bcbd21f6e70 (diff) | |
| download | cpython-1aa78938b0d019b7c9cbb153c2f35709ee01a19a.zip cpython-1aa78938b0d019b7c9cbb153c2f35709ee01a19a.tar.gz cpython-1aa78938b0d019b7c9cbb153c2f35709ee01a19a.tar.bz2 | |
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 c7def9a..b378ffe 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): |
