diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2022-07-31 15:33:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-31 15:33:56 (GMT) |
commit | aa37ffda29ac48fb2df5a7029ba2e626ecc45850 (patch) | |
tree | 748f6ebe2d1bcc3b34cf999b15c1618a9365597b /Lib/test/test_embed.py | |
parent | 50b2261bdac98303087287b24eef96abd45a82f9 (diff) | |
download | cpython-aa37ffda29ac48fb2df5a7029ba2e626ecc45850.zip cpython-aa37ffda29ac48fb2df5a7029ba2e626ecc45850.tar.gz cpython-aa37ffda29ac48fb2df5a7029ba2e626ecc45850.tar.bz2 |
bpo-45445: Revert "bpo-45445: Fail if an invalid X-option is provided in the command line (GH-28823)" (#94745)
Diffstat (limited to 'Lib/test/test_embed.py')
-rw-r--r-- | Lib/test/test_embed.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index c7e5663..c546bb0 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -283,7 +283,7 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase): "test_pre_initialization_sys_options", env=env) expected_output = ( "sys.warnoptions: ['once', 'module', 'default']\n" - "sys._xoptions: {'dev': '2', 'utf8': '1'}\n" + "sys._xoptions: {'not_an_option': '1', 'also_not_an_option': '2'}\n" "warnings.filters[:3]: ['default', 'module', 'once']\n" ) self.assertIn(expected_output, out) @@ -841,14 +841,15 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'argv': ['-c', 'arg2'], 'orig_argv': ['python3', '-W', 'cmdline_warnoption', - '-X', 'dev', + '-X', 'cmdline_xoption', '-c', 'pass', 'arg2'], 'parse_argv': 2, 'xoptions': [ - 'dev=3', - 'utf8', - 'dev', + 'config_xoption1=3', + 'config_xoption2=', + 'config_xoption3', + 'cmdline_xoption', ], 'warnoptions': [ 'cmdline_warnoption', @@ -1076,8 +1077,9 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): config = { 'faulthandler': 1, 'xoptions': [ - 'dev', - 'utf8', + 'config_xoption', + 'cmdline_xoption', + 'sysadd_xoption', 'faulthandler', ], 'warnoptions': [ @@ -1087,12 +1089,9 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): ], 'orig_argv': ['python3', '-W', 'ignore:::cmdline_warnoption', - '-X', 'utf8'], + '-X', 'cmdline_xoption'], } - preconfig = {'utf8_mode': 1} - self.check_all_configs("test_init_sys_add", config, - expected_preconfig=preconfig, - api=API_PYTHON) + self.check_all_configs("test_init_sys_add", config, api=API_PYTHON) def test_init_run_main(self): code = ('import _testinternalcapi, json; ' |