summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_embed.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-08-23 17:03:08 (GMT)
committerGitHub <noreply@github.com>2019-08-23 17:03:08 (GMT)
commit120b707a6d43452e067daa55a8fdca69f9424abc (patch)
tree1a58f651b55fde0a820646fdbf8b568657883273 /Lib/test/test_embed.py
parent1beb7c3de9c3d0e802e4267a11d937e8f024d661 (diff)
downloadcpython-120b707a6d43452e067daa55a8fdca69f9424abc.zip
cpython-120b707a6d43452e067daa55a8fdca69f9424abc.tar.gz
cpython-120b707a6d43452e067daa55a8fdca69f9424abc.tar.bz2
bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431)
PyConfig_Read() is now responsible to handle early calls to PySys_AddXOption() and PySys_AddWarnOption(). Options added by PySys_AddXOption() are now handled the same way than PyConfig.xoptions and command line -X options. For example, PySys_AddXOption(L"faulthandler") enables faulthandler as expected.
Diffstat (limited to 'Lib/test/test_embed.py')
-rw-r--r--Lib/test/test_embed.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py
index 6fb4012..2a5ace0 100644
--- a/Lib/test/test_embed.py
+++ b/Lib/test/test_embed.py
@@ -902,6 +902,23 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
api=API_PYTHON,
modify_path_cb=modify_path)
+ def test_init_sys_add(self):
+ config = {
+ 'faulthandler': 1,
+ 'xoptions': [
+ 'config_xoption',
+ 'cmdline_xoption',
+ 'sysadd_xoption',
+ 'faulthandler',
+ ],
+ 'warnoptions': [
+ 'ignore:::config_warnoption',
+ 'ignore:::cmdline_warnoption',
+ 'ignore:::sysadd_warnoption',
+ ],
+ }
+ self.check_all_configs("test_init_sys_add", config, api=API_PYTHON)
+
def test_init_run_main(self):
code = ('import _testinternalcapi, json; '
'print(json.dumps(_testinternalcapi.get_configs()))')