Skip to content

Commit 654673a

Browse files
Aniketsycolesbury
andauthored
Update Lib/test/test_queue.py
Co-authored-by: Sam Gross <colesbury@gmail.com>
1 parent de68f62 commit 654673a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Lib/test/test_queue.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,15 +1033,13 @@ def test_is_default(self):
10331033
self.assertIs(self.type2test, self.queue.SimpleQueue)
10341034
self.assertIs(self.type2test, self.queue.SimpleQueue)
10351035

1036-
def test_simplequeue_sizeof_reflects_buffer_growth(self):
1036+
def test_simplequeue_sizeof(self):
10371037
q = self.type2test()
1038-
before = sys.getsizeof(q)
1038+
basesize = support.calcobjsize('?nnPnnP')
1039+
support.check_sizeof(self, q, basesize + struct.calcsize(8 * 'P'))
10391040
for _ in range(1000):
10401041
q.put(object())
1041-
after = sys.getsizeof(q)
1042-
self.assertGreater(after, before)
1043-
ptr = support.calcobjsize("P") - support.calcobjsize("")
1044-
self.assertEqual((after - before) % ptr, 0)
1042+
support.check_sizeof(self, q, basesize + struct.calcsize(1024 * 'P'))
10451043

10461044
def test_reentrancy(self):
10471045
# bpo-14976: put() may be called reentrantly in an asynchronous

0 commit comments

Comments
 (0)