diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-03-06 11:51:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-06 11:51:53 (GMT) |
commit | 25d13f37aa6743282d0b8b4df687ff89999964b2 (patch) | |
tree | 88b7e7e0834b9c9d1ca13220d83bc6eb845137ea /Lib/test | |
parent | 01e0f439f5009f37b95ab516e91906fcc7fcb8c3 (diff) | |
download | cpython-25d13f37aa6743282d0b8b4df687ff89999964b2.zip cpython-25d13f37aa6743282d0b8b4df687ff89999964b2.tar.gz cpython-25d13f37aa6743282d0b8b4df687ff89999964b2.tar.bz2 |
bpo-36142: PYTHONMALLOC overrides PYTHONDEV (GH-12191)
bpo-34247, bpo-36142: The PYTHONMALLOC environment variable has the
priority over PYTHONDEV env var and "-X dev" command line option.
For example, PYTHONMALLOC=malloc PYTHONDEVMODE=1 sets the memory
allocators to "malloc" (and not to "debug").
Add an unit test.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_embed.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 1f236a9..952bc32 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -524,7 +524,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'install_signal_handlers': 0, 'use_hash_seed': 1, 'hash_seed': 123, - 'allocator': 'malloc_debug', + 'allocator': 'malloc', 'tracemalloc': 2, 'import_time': 1, 'show_ref_count': 1, @@ -564,7 +564,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): INIT_ENV_CONFIG = { 'use_hash_seed': 1, 'hash_seed': 42, - 'allocator': 'malloc_debug', + 'allocator': 'malloc', 'tracemalloc': 2, 'import_time': 1, 'malloc_stats': 1, @@ -592,6 +592,12 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): dev_mode=1) self.check_config("init_env_dev_mode", config) + def test_init_env_dev_mode(self): + config = dict(self.INIT_ENV_CONFIG, + allocator='malloc', + dev_mode=1) + self.check_config("init_env_dev_mode_alloc", config) + def test_init_dev_mode(self): config = { 'dev_mode': 1, |