diff Lib/test/test_sys.py @ 77577:d63a80abfbec

Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues
author David Malcolm <dmalcolm@redhat.com>
date Fri, 22 Jun 2012 14:55:41 -0400
parents 59ae1e96db1c
children 5093cfdff2a9
line wrap: on
line diff
--- a/Lib/test/test_sys.py	Fri Jun 22 18:40:02 2012 +0000
+++ b/Lib/test/test_sys.py	Fri Jun 22 14:55:41 2012 -0400
@@ -603,6 +603,12 @@
         self.assertEqual(sys.implementation.name,
                          sys.implementation.name.lower())
 
+    def test_debugmallocstats(self):
+        # Test sys._debugmallocstats()
+        from test.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)
 
 class SizeofTest(unittest.TestCase):