@@ -366,6 +366,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
366366 'program_name' : GET_DEFAULT_CONFIG ,
367367 'parse_argv' : 0 ,
368368 'argv' : ["" ],
369+ '_orig_argv' : [],
369370
370371 'xoptions' : [],
371372 'warnoptions' : [],
@@ -737,7 +738,12 @@ def test_init_from_config(self):
737738
738739 'pycache_prefix' : 'conf_pycache_prefix' ,
739740 'program_name' : './conf_program_name' ,
740- 'argv' : ['-c' , 'arg2' , ],
741+ 'argv' : ['-c' , 'arg2' ],
742+ '_orig_argv' : ['python3' ,
743+ '-W' , 'cmdline_warnoption' ,
744+ '-X' , 'cmdline_xoption' ,
745+ '-c' , 'pass' ,
746+ 'arg2' ],
741747 'parse_argv' : 1 ,
742748 'xoptions' : [
743749 'config_xoption1=3' ,
@@ -864,6 +870,7 @@ def test_preinit_parse_argv(self):
864870 }
865871 config = {
866872 'argv' : ['script.py' ],
873+ '_orig_argv' : ['python3' , '-X' , 'dev' , 'script.py' ],
867874 'run_filename' : os .path .abspath ('script.py' ),
868875 'dev_mode' : 1 ,
869876 'faulthandler' : 1 ,
@@ -878,9 +885,14 @@ def test_preinit_dont_parse_argv(self):
878885 preconfig = {
879886 'isolated' : 0 ,
880887 }
888+ argv = ["python3" ,
889+ "-E" , "-I" ,
890+ "-X" , "dev" ,
891+ "-X" , "utf8" ,
892+ "script.py" ]
881893 config = {
882- 'argv' : [ "python3" , "-E" , "-I" ,
883- "-X" , "dev" , "-X" , "utf8" , "script.py" ] ,
894+ 'argv' : argv ,
895+ '_orig_argv' : argv ,
884896 'isolated' : 0 ,
885897 }
886898 self .check_all_configs ("test_preinit_dont_parse_argv" , config , preconfig ,
@@ -959,6 +971,9 @@ def test_init_sys_add(self):
959971 'ignore:::sysadd_warnoption' ,
960972 'ignore:::config_warnoption' ,
961973 ],
974+ '_orig_argv' : ['python3' ,
975+ '-W' , 'ignore:::cmdline_warnoption' ,
976+ '-X' , 'cmdline_xoption' ],
962977 }
963978 self .check_all_configs ("test_init_sys_add" , config , api = API_PYTHON )
964979
@@ -967,6 +982,7 @@ def test_init_run_main(self):
967982 'print(json.dumps(_testinternalcapi.get_configs()))' )
968983 config = {
969984 'argv' : ['-c' , 'arg2' ],
985+ '_orig_argv' : ['python3' , '-c' , code , 'arg2' ],
970986 'program_name' : './python3' ,
971987 'run_command' : code + '\n ' ,
972988 'parse_argv' : 1 ,
@@ -978,6 +994,9 @@ def test_init_main(self):
978994 'print(json.dumps(_testinternalcapi.get_configs()))' )
979995 config = {
980996 'argv' : ['-c' , 'arg2' ],
997+ '_orig_argv' : ['python3' ,
998+ '-c' , code ,
999+ 'arg2' ],
9811000 'program_name' : './python3' ,
9821001 'run_command' : code + '\n ' ,
9831002 'parse_argv' : 1 ,
@@ -991,6 +1010,7 @@ def test_init_parse_argv(self):
9911010 config = {
9921011 'parse_argv' : 1 ,
9931012 'argv' : ['-c' , 'arg1' , '-v' , 'arg3' ],
1013+ '_orig_argv' : ['./argv0' , '-E' , '-c' , 'pass' , 'arg1' , '-v' , 'arg3' ],
9941014 'program_name' : './argv0' ,
9951015 'run_command' : 'pass\n ' ,
9961016 'use_environment' : 0 ,
@@ -1004,6 +1024,7 @@ def test_init_dont_parse_argv(self):
10041024 config = {
10051025 'parse_argv' : 0 ,
10061026 'argv' : ['./argv0' , '-E' , '-c' , 'pass' , 'arg1' , '-v' , 'arg3' ],
1027+ '_orig_argv' : ['./argv0' , '-E' , '-c' , 'pass' , 'arg1' , '-v' , 'arg3' ],
10071028 'program_name' : './argv0' ,
10081029 }
10091030 self .check_all_configs ("test_init_dont_parse_argv" , config , pre_config ,
@@ -1291,10 +1312,17 @@ def test_init_warnoptions(self):
12911312 'faulthandler' : 1 ,
12921313 'bytes_warning' : 1 ,
12931314 'warnoptions' : warnoptions ,
1315+ '_orig_argv' : ['python3' ,
1316+ '-Wignore:::cmdline1' ,
1317+ '-Wignore:::cmdline2' ],
12941318 }
12951319 self .check_all_configs ("test_init_warnoptions" , config , preconfig ,
12961320 api = API_PYTHON )
12971321
1322+ def test_get_argc_argv (self ):
1323+ self .run_embedded_interpreter ("test_get_argc_argv" )
1324+ # ignore output
1325+
12981326
12991327class AuditingTests (EmbeddingTestsMixin , unittest .TestCase ):
13001328 def test_open_code_hook (self ):
0 commit comments