Use correct PyGC_Head size in tests for issue #25421.
This commit is contained in:
parent
5c4064e8bd
commit
9c297e43bf
|
@ -1115,7 +1115,7 @@ class SizeofTest(unittest.TestCase):
|
||||||
def check_slots(self, obj, base, extra):
|
def check_slots(self, obj, base, extra):
|
||||||
expected = sys.getsizeof(base) + struct.calcsize(extra)
|
expected = sys.getsizeof(base) + struct.calcsize(extra)
|
||||||
if gc.is_tracked(obj) and not gc.is_tracked(base):
|
if gc.is_tracked(obj) and not gc.is_tracked(base):
|
||||||
expected += struct.calcsize('2Pn') # PyGC_Head
|
expected += self.gc_headsize
|
||||||
self.assertEqual(sys.getsizeof(obj), expected)
|
self.assertEqual(sys.getsizeof(obj), expected)
|
||||||
|
|
||||||
def test_slots(self):
|
def test_slots(self):
|
||||||
|
|
Loading…
Reference in New Issue