Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 796a1c5..9a6dd5b 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -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):