Unverified Kaydet (Commit) 06be9daf authored tarafından Victor Stinner's avatar Victor Stinner Kaydeden (comit) GitHub

bpo-32030: Fix test_sys.test_getallocatedblocks() (#4637)

Skip the test if PYTHONMALLOC environment variable is set.
üst 23cc8c0f
...@@ -778,6 +778,10 @@ class SysModuleTest(unittest.TestCase): ...@@ -778,6 +778,10 @@ class SysModuleTest(unittest.TestCase):
@unittest.skipUnless(hasattr(sys, "getallocatedblocks"), @unittest.skipUnless(hasattr(sys, "getallocatedblocks"),
"sys.getallocatedblocks unavailable on this build") "sys.getallocatedblocks unavailable on this build")
def test_getallocatedblocks(self): 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 # Some sanity checks
with_pymalloc = sysconfig.get_config_var('WITH_PYMALLOC') with_pymalloc = sysconfig.get_config_var('WITH_PYMALLOC')
a = sys.getallocatedblocks() a = sys.getallocatedblocks()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment