@@ -82,7 +82,7 @@ def run_embedded_interpreter(self, *args, env=None):
8282 return out , err
8383
8484 def run_repeated_init_and_subinterpreters (self ):
85- out , err = self .run_embedded_interpreter ("repeated_init_and_subinterpreters " )
85+ out , err = self .run_embedded_interpreter ("test_repeated_init_and_subinterpreters " )
8686 self .assertEqual (err , "" )
8787
8888 # The output from _testembed looks like this:
@@ -172,7 +172,7 @@ def test_subinterps_distinct_state(self):
172172 def test_forced_io_encoding (self ):
173173 # Checks forced configuration of embedded interpreter IO streams
174174 env = dict (os .environ , PYTHONIOENCODING = "utf-8:surrogateescape" )
175- out , err = self .run_embedded_interpreter ("forced_io_encoding " , env = env )
175+ out , err = self .run_embedded_interpreter ("test_forced_io_encoding " , env = env )
176176 if support .verbose > 1 :
177177 print ()
178178 print (out )
@@ -218,7 +218,7 @@ def test_pre_initialization_api(self):
218218 is initialized (via Py_Initialize()).
219219 """
220220 env = dict (os .environ , PYTHONPATH = os .pathsep .join (sys .path ))
221- out , err = self .run_embedded_interpreter ("pre_initialization_api " , env = env )
221+ out , err = self .run_embedded_interpreter ("test_pre_initialization_api " , env = env )
222222 if MS_WINDOWS :
223223 expected_path = self .test_exe
224224 else :
@@ -234,7 +234,7 @@ def test_pre_initialization_sys_options(self):
234234 """
235235 env = dict (os .environ , PYTHONPATH = os .pathsep .join (sys .path ))
236236 out , err = self .run_embedded_interpreter (
237- "pre_initialization_sys_options " , env = env )
237+ "test_pre_initialization_sys_options " , env = env )
238238 expected_output = (
239239 "sys.warnoptions: ['once', 'module', 'default']\n "
240240 "sys._xoptions: {'not_an_option': '1', 'also_not_an_option': '2'}\n "
@@ -249,7 +249,7 @@ def test_bpo20891(self):
249249 calling PyEval_InitThreads() must not crash. PyGILState_Ensure() must
250250 call PyEval_InitThreads() for us in this case.
251251 """
252- out , err = self .run_embedded_interpreter ("bpo20891 " )
252+ out , err = self .run_embedded_interpreter ("test_bpo20891 " )
253253 self .assertEqual (out , '' )
254254 self .assertEqual (err , '' )
255255
@@ -258,20 +258,20 @@ def test_initialize_twice(self):
258258 bpo-33932: Calling Py_Initialize() twice should do nothing (and not
259259 crash!).
260260 """
261- out , err = self .run_embedded_interpreter ("initialize_twice " )
261+ out , err = self .run_embedded_interpreter ("test_initialize_twice " )
262262 self .assertEqual (out , '' )
263263 self .assertEqual (err , '' )
264264
265265 def test_initialize_pymain (self ):
266266 """
267267 bpo-34008: Calling Py_Main() after Py_Initialize() must not fail.
268268 """
269- out , err = self .run_embedded_interpreter ("initialize_pymain " )
269+ out , err = self .run_embedded_interpreter ("test_initialize_pymain " )
270270 self .assertEqual (out .rstrip (), "Py_Main() after Py_Initialize: sys.argv=['-c', 'arg2']" )
271271 self .assertEqual (err , '' )
272272
273273 def test_run_main (self ):
274- out , err = self .run_embedded_interpreter ("run_main " )
274+ out , err = self .run_embedded_interpreter ("test_run_main " )
275275 self .assertEqual (out .rstrip (), "_Py_RunMain(): sys.argv=['-c', 'arg2']" )
276276 self .assertEqual (err , '' )
277277
@@ -632,13 +632,13 @@ def check_config(self, testname, expected_config=None,
632632 self .check_global_config (config )
633633
634634 def test_init_default_config (self ):
635- self .check_config ("init_initialize_config " , api = API_COMPAT )
635+ self .check_config ("test_init_initialize_config " , api = API_COMPAT )
636636
637637 def test_preinit_compat_config (self ):
638- self .check_config ("preinit_compat_config " , api = API_COMPAT )
638+ self .check_config ("test_preinit_compat_config " , api = API_COMPAT )
639639
640640 def test_init_compat_config (self ):
641- self .check_config ("init_compat_config " , api = API_COMPAT )
641+ self .check_config ("test_init_compat_config " , api = API_COMPAT )
642642
643643 def test_init_global_config (self ):
644644 preconfig = {
@@ -660,7 +660,7 @@ def test_init_global_config(self):
660660 'user_site_directory' : 0 ,
661661 'pathconfig_warnings' : 0 ,
662662 }
663- self .check_config ("init_global_config " , config , preconfig ,
663+ self .check_config ("test_init_global_config " , config , preconfig ,
664664 api = API_COMPAT )
665665
666666 def test_init_from_config (self ):
@@ -705,7 +705,7 @@ def test_init_from_config(self):
705705 'check_hash_pycs_mode' : 'always' ,
706706 'pathconfig_warnings' : 0 ,
707707 }
708- self .check_config ("init_from_config " , config , preconfig ,
708+ self .check_config ("test_init_from_config " , config , preconfig ,
709709 api = API_COMPAT )
710710
711711 def test_init_env (self ):
@@ -732,23 +732,23 @@ def test_init_env(self):
732732 'faulthandler' : 1 ,
733733 'warnoptions' : ['EnvVar' ],
734734 }
735- self .check_config ("init_env " , config , preconfig ,
735+ self .check_config ("test_init_env " , config , preconfig ,
736736 api = API_COMPAT )
737737
738738 def test_init_env_dev_mode (self ):
739739 preconfig = dict (allocator = PYMEM_ALLOCATOR_DEBUG )
740740 config = dict (dev_mode = 1 ,
741741 faulthandler = 1 ,
742742 warnoptions = ['default' ])
743- self .check_config ("init_env_dev_mode " , config , preconfig ,
743+ self .check_config ("test_init_env_dev_mode " , config , preconfig ,
744744 api = API_COMPAT )
745745
746746 def test_init_env_dev_mode_alloc (self ):
747747 preconfig = dict (allocator = PYMEM_ALLOCATOR_MALLOC )
748748 config = dict (dev_mode = 1 ,
749749 faulthandler = 1 ,
750750 warnoptions = ['default' ])
751- self .check_config ("init_env_dev_mode_alloc " , config , preconfig ,
751+ self .check_config ("test_init_env_dev_mode_alloc " , config , preconfig ,
752752 api = API_COMPAT )
753753
754754 def test_init_dev_mode (self ):
@@ -760,7 +760,7 @@ def test_init_dev_mode(self):
760760 'dev_mode' : 1 ,
761761 'warnoptions' : ['default' ],
762762 }
763- self .check_config ("init_dev_mode " , config , preconfig ,
763+ self .check_config ("test_init_dev_mode " , config , preconfig ,
764764 api = API_PYTHON )
765765
766766 def test_preinit_parse_argv (self ):
@@ -777,7 +777,7 @@ def test_preinit_parse_argv(self):
777777 'warnoptions' : ['default' ],
778778 'xoptions' : ['dev' ],
779779 }
780- self .check_config ("preinit_parse_argv " , config , preconfig ,
780+ self .check_config ("test_preinit_parse_argv " , config , preconfig ,
781781 api = API_PYTHON )
782782
783783 def test_preinit_dont_parse_argv (self ):
@@ -790,7 +790,7 @@ def test_preinit_dont_parse_argv(self):
790790 "-X" , "dev" , "-X" , "utf8" , "script.py" ],
791791 'isolated' : 0 ,
792792 }
793- self .check_config ("preinit_dont_parse_argv " , config , preconfig ,
793+ self .check_config ("test_preinit_dont_parse_argv " , config , preconfig ,
794794 api = API_ISOLATED )
795795
796796 def test_init_isolated_flag (self ):
@@ -799,7 +799,7 @@ def test_init_isolated_flag(self):
799799 'use_environment' : 0 ,
800800 'user_site_directory' : 0 ,
801801 }
802- self .check_config ("init_isolated_flag " , config , api = API_PYTHON )
802+ self .check_config ("test_init_isolated_flag " , config , api = API_PYTHON )
803803
804804 def test_preinit_isolated1 (self ):
805805 # _PyPreConfig.isolated=1, _PyCoreConfig.isolated not set
@@ -808,7 +808,7 @@ def test_preinit_isolated1(self):
808808 'use_environment' : 0 ,
809809 'user_site_directory' : 0 ,
810810 }
811- self .check_config ("preinit_isolated1 " , config , api = API_COMPAT )
811+ self .check_config ("test_preinit_isolated1 " , config , api = API_COMPAT )
812812
813813 def test_preinit_isolated2 (self ):
814814 # _PyPreConfig.isolated=0, _PyCoreConfig.isolated=1
@@ -817,32 +817,35 @@ def test_preinit_isolated2(self):
817817 'use_environment' : 0 ,
818818 'user_site_directory' : 0 ,
819819 }
820- self .check_config ("preinit_isolated2 " , config , api = API_COMPAT )
820+ self .check_config ("test_preinit_isolated2 " , config , api = API_COMPAT )
821821
822822 def test_preinit_isolated_config (self ):
823- self .check_config ("preinit_isolated_config " , api = API_ISOLATED )
823+ self .check_config ("test_preinit_isolated_config " , api = API_ISOLATED )
824824
825825 def test_init_isolated_config (self ):
826- self .check_config ("init_isolated_config" , api = API_ISOLATED )
826+ self .check_config ("test_init_isolated_config" , api = API_ISOLATED )
827+
828+ def test_preinit_python_config (self ):
829+ self .check_config ("test_preinit_python_config" , api = API_PYTHON )
827830
828831 def test_init_python_config (self ):
829- self .check_config ("init_python_config " , api = API_PYTHON )
832+ self .check_config ("test_init_python_config " , api = API_PYTHON )
830833
831834 def test_init_dont_configure_locale (self ):
832835 # _PyPreConfig.configure_locale=0
833836 preconfig = {
834837 'configure_locale' : 0 ,
835838 'coerce_c_locale' : 0 ,
836839 }
837- self .check_config ("init_dont_configure_locale " , {}, preconfig ,
840+ self .check_config ("test_init_dont_configure_locale " , {}, preconfig ,
838841 api = API_PYTHON )
839842
840843 def test_init_read_set (self ):
841844 core_config = {
842845 'program_name' : './init_read_set' ,
843846 'executable' : 'my_executable' ,
844847 }
845- self .check_config ("init_read_set " , core_config ,
848+ self .check_config ("test_init_read_set " , core_config ,
846849 api = API_PYTHON ,
847850 add_path = "init_read_set_path" )
848851
@@ -855,7 +858,7 @@ def test_init_run_main(self):
855858 'run_command' : code + '\n ' ,
856859 'parse_argv' : 1 ,
857860 }
858- self .check_config ("init_run_main " , core_config , api = API_PYTHON )
861+ self .check_config ("test_init_run_main " , core_config , api = API_PYTHON )
859862
860863 def test_init_main (self ):
861864 code = ('import _testinternalcapi, json; '
@@ -867,7 +870,7 @@ def test_init_main(self):
867870 'parse_argv' : 1 ,
868871 '_init_main' : 0 ,
869872 }
870- self .check_config ("init_main " , core_config ,
873+ self .check_config ("test_init_main " , core_config ,
871874 api = API_PYTHON ,
872875 stderr = "Run Python code before _Py_InitializeMain" )
873876
@@ -879,7 +882,7 @@ def test_init_parse_argv(self):
879882 'run_command' : 'pass\n ' ,
880883 'use_environment' : 0 ,
881884 }
882- self .check_config ("init_parse_argv " , core_config , api = API_PYTHON )
885+ self .check_config ("test_init_parse_argv " , core_config , api = API_PYTHON )
883886
884887 def test_init_dont_parse_argv (self ):
885888 pre_config = {
@@ -890,7 +893,7 @@ def test_init_dont_parse_argv(self):
890893 'argv' : ['./argv0' , '-E' , '-c' , 'pass' , 'arg1' , '-v' , 'arg3' ],
891894 'program_name' : './argv0' ,
892895 }
893- self .check_config ("init_dont_parse_argv " , core_config , pre_config ,
896+ self .check_config ("test_init_dont_parse_argv " , core_config , pre_config ,
894897 api = API_PYTHON )
895898
896899
0 commit comments