From 06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 29 Nov 2017 23:51:41 +0100 Subject: bpo-32030: Fix test_sys.test_getallocatedblocks() (#4637) Skip the test if PYTHONMALLOC environment variable is set. --- Lib/test/test_sys.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index a47a6bb..7866a5c 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -778,6 +778,10 @@ class SysModuleTest(unittest.TestCase): @unittest.skipUnless(hasattr(sys, "getallocatedblocks"), "sys.getallocatedblocks unavailable on this build") def test_getallocatedblocks(self): + if (os.environ.get('PYTHONMALLOC', None) + and not sys.flags.ignore_environment): + self.skipTest("cannot test if PYTHONMALLOC env var is set") + # Some sanity checks with_pymalloc = sysconfig.get_config_var('WITH_PYMALLOC') a = sys.getallocatedblocks() -- cgit v0.12