mirror of
https://github.com/python/cpython.git
synced 2025-09-03 23:41:18 +00:00
bpo-45445: Revert "bpo-45445: Fail if an invalid X-option is provided in the command line (GH-28823)" (#94745)
This commit is contained in:
parent
50b2261bda
commit
aa37ffda29
6 changed files with 27 additions and 83 deletions
|
@ -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; '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue