summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-07-03 19:30:49 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-07-03 19:30:49 (GMT)
commitbae75cf3fe975d21c0c20baa595d21ebeca54681 (patch)
tree5d1b8a52a7c505d5eacd37f8525ccb230776ba27 /Lib/test/test_sys.py
parent7e160ce356036bccda2608d9ee10bfe276dfa97a (diff)
parenta793037d803abf098d172f686e2b95d27863c54d (diff)
downloadcpython-bae75cf3fe975d21c0c20baa595d21ebeca54681.zip
cpython-bae75cf3fe975d21c0c20baa595d21ebeca54681.tar.gz
cpython-bae75cf3fe975d21c0c20baa595d21ebeca54681.tar.bz2
Issue #19527: Fixed tests with defined COUNT_ALLOCS.
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r--Lib/test/test_sys.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index a531879..4435d69 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -803,6 +803,7 @@ class SysModuleTest(unittest.TestCase):
c = sys.getallocatedblocks()
self.assertIn(c, range(b - 50, b + 50))
+ @test.support.requires_type_collecting
def test_is_finalizing(self):
self.assertIs(sys.is_finalizing(), False)
# Don't use the atexit module because _Py_Finalizing is only set
@@ -1083,9 +1084,12 @@ class SizeofTest(unittest.TestCase):
check((1,2,3), vsize('') + 3*self.P)
# type
# static type: PyTypeObject
- s = vsize('P2n15Pl4Pn9Pn11PIP')
+ fmt = 'P2n15Pl4Pn9Pn11PIP'
+ if hasattr(sys, 'getcounts'):
+ fmt += '3n2P'
+ s = vsize(fmt)
check(int, s)
- s = vsize('P2n15Pl4Pn9Pn11PIP' # PyTypeObject
+ s = vsize(fmt + # PyTypeObject
'3P' # PyAsyncMethods
'36P' # PyNumberMethods
'3P' # PyMappingMethods