fix test_sys (patch 134)

This commit is contained in:
David Malcolm 2012-07-23 11:27:17 -04:00
parent 1c94c1ae4e
commit a4dad5ac96
1 changed files with 12 additions and 4 deletions

View File

@ -1,11 +1,19 @@
diff -up Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys Python-3.3.0b1/Lib/test/test_sys.py
--- Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-06-26 16:19:48.000000000 -0400
+++ Python-3.3.0b1/Lib/test/test_sys.py 2012-07-20 13:44:23.050740172 -0400
@@ -869,6 +869,9 @@ class SizeofTest(unittest.TestCase):
--- Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-07-23 11:18:52.524602807 -0400
+++ Python-3.3.0b1/Lib/test/test_sys.py 2012-07-23 11:25:54.641325620 -0400
@@ -863,12 +863,17 @@ class SizeofTest(unittest.TestCase):
# type
# static type: PyTypeObject
s = size(vh + 'P2P15Pl4PP9PP11PI')
+ # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers:
+ if hasattr(sys, 'getcounts'):
+ s += size('3P2P')
check(int, s)
# (PyTypeObject + PyNumberMethods + PyMappingMethods +
# PySequenceMethods + PyBufferProcs + 4P)
s = size(vh + 'P2P15Pl4PP9PP11PI') + size('34P 3P 10P 2P 4P')
# Separate block for PyDictKeysObject with 4 entries
s += size("PPPP") + 4*size("PPP")
+ # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers:
+ if hasattr(sys, 'getcounts'):
+ s += size('3P2P')
# class