summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-29 22:51:41 (GMT)
committerGitHub <noreply@github.com>2017-11-29 22:51:41 (GMT)
commit06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a (patch)
tree907e0476d38500739526248e84b12c42d1be5376 /Lib/test/test_sys.py
parent23cc8c0f9ece32f1f96133b9db2cb30c64f23a0e (diff)
downloadcpython-06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a.zip
cpython-06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a.tar.gz
cpython-06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a.tar.bz2
bpo-32030: Fix test_sys.test_getallocatedblocks() (#4637)
Skip the test if PYTHONMALLOC environment variable is set.
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r--Lib/test/test_sys.py4
1 files changed, 4 insertions, 0 deletions
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()