summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-12-17 22:05:59 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-12-17 22:05:59 (GMT)
commit928405303dfdb740e5b40815a0cfdb2da92f768d (patch)
tree1770f5a48cd9751873ecaba8d73981b19e094b57 /Lib/test/test_sys.py
parent3438fa496db50ef3cafcfdb3243f2f769bc12ebe (diff)
downloadcpython-928405303dfdb740e5b40815a0cfdb2da92f768d.zip
cpython-928405303dfdb740e5b40815a0cfdb2da92f768d.tar.gz
cpython-928405303dfdb740e5b40815a0cfdb2da92f768d.tar.bz2
Following issue #13390, fix compilation --without-pymalloc, and make sys.getallocatedblocks() return 0 in that situation.
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r--Lib/test/test_sys.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 055592b..41f1439 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -7,6 +7,7 @@ import warnings
import operator
import codecs
import gc
+import sysconfig
# count the number of test runs, used to create unique
# strings to intern in test_intern()
@@ -616,9 +617,13 @@ class SysModuleTest(unittest.TestCase):
"sys.getallocatedblocks unavailable on this build")
def test_getallocatedblocks(self):
# Some sanity checks
+ with_pymalloc = sysconfig.get_config_var('WITH_PYMALLOC')
a = sys.getallocatedblocks()
self.assertIs(type(a), int)
- self.assertGreater(a, 0)
+ if with_pymalloc:
+ self.assertGreater(a, 0)
+ else:
+ self.assertEqual(a, 0)
try:
# While we could imagine a Python session where the number of
# multiple buffer objects would exceed the sharing of references,