diff options
author | Raymond Hettinger <python@rcn.com> | 2010-09-16 19:10:17 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-09-16 19:10:17 (GMT) |
commit | 35c87f2b8e5cc62c91a3bdbaec4de50d366f6228 (patch) | |
tree | ed16a4b9ea45825df7510db71ae11ea1a6ebf6b3 /Lib/test/test_collections.py | |
parent | 234f88dc73d4324851c4b624110f7afe699c1dbf (diff) | |
download | cpython-35c87f2b8e5cc62c91a3bdbaec4de50d366f6228.zip cpython-35c87f2b8e5cc62c91a3bdbaec4de50d366f6228.tar.gz cpython-35c87f2b8e5cc62c91a3bdbaec4de50d366f6228.tar.bz2 |
Issue 9865: add __sizeof__ to OrderedDict.
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r-- | Lib/test/test_collections.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 514dc39..51e93e4 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -994,6 +994,12 @@ class TestOrderedDict(unittest.TestCase): with self.assertRaises(KeyError): od.move_to_end('x') + def test_sizeof(self): + # Wimpy test: Just verify the reported size is larger than a regular dict + d = dict(a=1) + od = OrderedDict(**d) + self.assertGreater(sys.getsizeof(od), sys.getsizeof(d)) + class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol): type2test = OrderedDict |