From fde7890f489659050ba2f1520be16409cd64e102 Mon Sep 17 00:00:00 2001 From: Jesus Cea Date: Mon, 23 Jul 2012 18:14:45 +0200 Subject: [PATCH] Better test for Issue #15402: Add a __sizeof__ method to struct.Struct --- Doc/ACKS.txt | 1 + Lib/test/test_struct.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Doc/ACKS.txt b/Doc/ACKS.txt index 7507c6c6b76..d32fcd927d0 100644 --- a/Doc/ACKS.txt +++ b/Doc/ACKS.txt @@ -197,6 +197,7 @@ docs@python.org), and we'll be glad to correct the problem. * Anthony Starks * Greg Stein * Peter Stoehr + * Serhiy Storchaka * Mark Summerfield * Reuben Sumner * Kalle Svensson diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index caada9cadba..f810ffe755f 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -547,12 +547,12 @@ class StructTest(unittest.TestCase): def test_sizeof(self): self.assertGreater(sys.getsizeof(struct.Struct('BHILfdspP')), sys.getsizeof(struct.Struct('B'))) - self.assertGreaterEqual(sys.getsizeof(struct.Struct('123B')), + self.assertGreater(sys.getsizeof(struct.Struct('123B')), sys.getsizeof(struct.Struct('B'))) - self.assertGreaterEqual(sys.getsizeof(struct.Struct('B' * 123)), + self.assertGreater(sys.getsizeof(struct.Struct('B' * 1234)), + sys.getsizeof(struct.Struct('123B'))) + self.assertGreater(sys.getsizeof(struct.Struct('1234B')), sys.getsizeof(struct.Struct('123B'))) - self.assertGreaterEqual(sys.getsizeof(struct.Struct('123xB')), - sys.getsizeof(struct.Struct('B'))) def test_main(): run_unittest(StructTest)