summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_sys.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 2182898..b0688e1 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -825,7 +825,18 @@ class SysModuleTest(unittest.TestCase):
from test.support.script_helper import assert_python_ok
args = ['-c', 'import sys; sys._debugmallocstats()']
ret, out, err = assert_python_ok(*args)
- self.assertIn(b"free PyDictObjects", err)
+
+ # Output of sys._debugmallocstats() depends on configure flags.
+ # The sysconfig vars are not available on Windows.
+ if sys.platform != "win32":
+ with_freelists = sysconfig.get_config_var("WITH_FREELISTS")
+ with_pymalloc = sysconfig.get_config_var("WITH_PYMALLOC")
+ if with_freelists:
+ self.assertIn(b"free PyDictObjects", err)
+ if with_pymalloc:
+ self.assertIn(b'Small block threshold', err)
+ if not with_freelists and not with_pymalloc:
+ self.assertFalse(err)
# The function has no parameter
self.assertRaises(TypeError, sys._debugmallocstats, True)