diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-03-26 15:58:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-26 15:58:50 (GMT) |
commit | f8ba6f5afc317d1be3025db1be410ac66a7e5a27 (patch) | |
tree | 531f75949653a2843d2834f253d26f5d366e6111 /Lib | |
parent | 414b1cde93764cdabb0798b02af4dd7df954424d (diff) | |
download | cpython-f8ba6f5afc317d1be3025db1be410ac66a7e5a27.zip cpython-f8ba6f5afc317d1be3025db1be410ac66a7e5a27.tar.gz cpython-f8ba6f5afc317d1be3025db1be410ac66a7e5a27.tar.bz2 |
bpo-36301: Cleanup preconfig.c and coreconfig.c (GH-12563)
* _PyCoreConfig_Write() now updates _PyRuntime.preconfig
* Remove _PyPreCmdline_Copy()
* _PyPreCmdline_Read() now accepts _PyPreConfig and _PyCoreConfig
optional configurations.
* Rename _PyPreConfig_ReadFromArgv() to _PyPreConfig_Read(). Simplify
the code.
* Calling _PyCoreConfig_Read() no longer adds the warning options
twice: don't add a warning option if it's already in the list.
* Rename _PyCoreConfig_ReadFromArgv() to _PyCoreConfig_Read().
* Rename config_from_cmdline() to _PyCoreConfig_ReadFromArgv().
* Add more assertions on _PyCoreConfig in _PyCoreConfig_Read().
* Move some functions.
* Make some config functions private.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_embed.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index ff3cfb1..7efd5be 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -302,7 +302,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'pycache_prefix': None, 'program_name': './_testembed', 'argv': [""], - 'program': None, + 'program': '', 'xoptions': [], 'warnoptions': [], @@ -537,6 +537,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'program_name': './globalvar', 'site_import': 0, 'bytes_warning': 1, + 'warnoptions': ['default::BytesWarning'], 'inspect': 1, 'interactive': 1, 'optimization_level': 2, @@ -579,7 +580,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'argv': ['-c', 'pass'], 'program': 'conf_program', 'xoptions': ['core_xoption1=3', 'core_xoption2=', 'core_xoption3'], - 'warnoptions': ['default', 'error::ResourceWarning'], + 'warnoptions': ['error::ResourceWarning', 'default::BytesWarning'], 'site_import': 0, 'bytes_warning': 1, @@ -629,14 +630,16 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): preconfig = dict(self.INIT_ENV_PRECONFIG, allocator='debug') config = dict(self.INIT_ENV_CONFIG, - dev_mode=1) + dev_mode=1, + warnoptions=['default']) self.check_config("init_env_dev_mode", config, preconfig) def test_init_env_dev_mode_alloc(self): preconfig = dict(self.INIT_ENV_PRECONFIG, allocator='malloc') config = dict(self.INIT_ENV_CONFIG, - dev_mode=1) + dev_mode=1, + warnoptions=['default']) self.check_config("init_env_dev_mode_alloc", config, preconfig) def test_init_dev_mode(self): @@ -646,14 +649,12 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): config = { 'faulthandler': 1, 'dev_mode': 1, + 'warnoptions': ['default'], } self.check_config("init_dev_mode", config, preconfig) def test_init_isolated(self): - preconfig = { - 'isolated': 0, - 'use_environment': 1, - } + preconfig = {} config = { 'isolated': 1, 'use_environment': 0, |