diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-03-05 16:37:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-05 16:37:44 (GMT) |
commit | b35be4b3334fbc471a39abbeb68110867b72e3e5 (patch) | |
tree | 4c311249db97ae7ebc5d2cb9ed48791549512afe /Lib | |
parent | 359a2f3daba49fde0d3a07fb3c7a8b051c450d08 (diff) | |
download | cpython-b35be4b3334fbc471a39abbeb68110867b72e3e5.zip cpython-b35be4b3334fbc471a39abbeb68110867b72e3e5.tar.gz cpython-b35be4b3334fbc471a39abbeb68110867b72e3e5.tar.bz2 |
bpo-36142: Add _PyPreConfig.allocator (GH-12181)
* Move 'allocator' and 'dev_mode' fields from _PyCoreConfig
to _PyPreConfig.
* Fix InitConfigTests of test_embed: dev_mode sets allocator to
"debug", add a new tests for env vars with dev mode enabled.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_embed.py | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 6c245eb..1f236a9 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -561,30 +561,36 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): } self.check_config("init_from_config", config) + INIT_ENV_CONFIG = { + 'use_hash_seed': 1, + 'hash_seed': 42, + 'allocator': 'malloc_debug', + 'tracemalloc': 2, + 'import_time': 1, + 'malloc_stats': 1, + 'utf8_mode': 1, + 'filesystem_encoding': 'utf-8', + 'filesystem_errors': UTF8_MODE_ERRORS, + 'inspect': 1, + 'optimization_level': 2, + 'pycache_prefix': 'env_pycache_prefix', + 'write_bytecode': 0, + 'verbose': 1, + 'buffered_stdio': 0, + 'stdio_encoding': 'iso8859-1', + 'stdio_errors': 'replace', + 'user_site_directory': 0, + 'faulthandler': 1, + } + def test_init_env(self): - config = { - 'use_hash_seed': 1, - 'hash_seed': 42, - 'allocator': 'malloc_debug', - 'tracemalloc': 2, - 'import_time': 1, - 'malloc_stats': 1, - 'utf8_mode': 1, - 'filesystem_encoding': 'utf-8', - 'filesystem_errors': self.UTF8_MODE_ERRORS, - 'inspect': 1, - 'optimization_level': 2, - 'pycache_prefix': 'env_pycache_prefix', - 'write_bytecode': 0, - 'verbose': 1, - 'buffered_stdio': 0, - 'stdio_encoding': 'iso8859-1', - 'stdio_errors': 'replace', - 'user_site_directory': 0, - 'faulthandler': 1, - 'dev_mode': 1, - } - self.check_config("init_env", config) + self.check_config("init_env", self.INIT_ENV_CONFIG) + + def test_init_env_dev_mode(self): + config = dict(self.INIT_ENV_CONFIG, + allocator='debug', + dev_mode=1) + self.check_config("init_env_dev_mode", config) def test_init_dev_mode(self): config = { |