From: Victor Stinner Date: Wed, 29 Nov 2017 22:51:41 +0000 (+0100) Subject: bpo-32030: Fix test_sys.test_getallocatedblocks() (#4637) X-Git-Tag: v3.6.4rc1~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a;p=python bpo-32030: Fix test_sys.test_getallocatedblocks() (#4637) Skip the test if PYTHONMALLOC environment variable is set. --- diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index a47a6bbc96..7866a5c005 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()