summaryrefslogtreecommitdiff
path: root/Lib/test/test_marshal.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-02-11 13:12:19 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2016-02-11 13:12:19 +0200
commit20ac73fb7133c119974eb21693d2621b09585ca0 (patch)
treec5cb3670b54a783d3a4328c5b189669c737ca594 /Lib/test/test_marshal.py
parentc2154d6c07cab7d173204a5f157aea44175be7a0 (diff)
parent2b442f7d5b61dcefc5a7a18a6e7af9de5983790c (diff)
downloadcpython-20ac73fb7133c119974eb21693d2621b09585ca0.tar.gz
Issue #26325: Added test.support.check_no_resource_warning() to check that
no ResourceWarning is emitted.
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):