Skip to content

Commit 06be9da

Browse files
authored
bpo-32030: Fix test_sys.test_getallocatedblocks() (#4637)
Skip the test if PYTHONMALLOC environment variable is set.
1 parent 23cc8c0 commit 06be9da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_sys.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,10 @@ def test_debugmallocstats(self):
778778
@unittest.skipUnless(hasattr(sys, "getallocatedblocks"),
779779
"sys.getallocatedblocks unavailable on this build")
780780
def test_getallocatedblocks(self):
781+
if (os.environ.get('PYTHONMALLOC', None)
782+
and not sys.flags.ignore_environment):
783+
self.skipTest("cannot test if PYTHONMALLOC env var is set")
784+
781785
# Some sanity checks
782786
with_pymalloc = sysconfig.get_config_var('WITH_PYMALLOC')
783787
a = sys.getallocatedblocks()

0 commit comments

Comments
 (0)