| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cfb241b commit 5edcf26
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,7 +82,7 @@ def run_embedded_interpreter(self, *args, env=None): | |||
| 82 | 82 | return out, err | |
| 83 | 83 | ||
| 84 | 84 | 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") | ||
| 86 | 86 | self.assertEqual(err, "") | |
| 87 | 87 | ||
| 88 | 88 | # The output from _testembed looks like this: | |
@@ -172,7 +172,7 @@ def test_subinterps_distinct_state(self): | |||
| 172 | 172 | def test_forced_io_encoding(self): | |
| 173 | 173 | # Checks forced configuration of embedded interpreter IO streams | |
| 174 | 174 | 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) | ||
| 176 | 176 | if support.verbose > 1: | |
| 177 | 177 | print() | |
| 178 | 178 | print(out) | |
@@ -218,7 +218,7 @@ def test_pre_initialization_api(self): | |||
| 218 | 218 | is initialized (via Py_Initialize()). | |
| 219 | 219 | """ | |
| 220 | 220 | 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) | ||
| 222 | 222 | if MS_WINDOWS: | |
| 223 | 223 | expected_path = self.test_exe | |
| 224 | 224 | else: | |
@@ -234,7 +234,7 @@ def test_pre_initialization_sys_options(self): | |||
| 234 | 234 | """ | |
| 235 | 235 | env = dict(os.environ, PYTHONPATH=os.pathsep.join(sys.path)) | |
| 236 | 236 | out, err = self.run_embedded_interpreter( | |
| 237 | - "pre_initialization_sys_options", env=env) | ||
| 237 | + "test_pre_initialization_sys_options", env=env) | ||
| 238 | 238 | expected_output = ( | |
| 239 | 239 | "sys.warnoptions: ['once', 'module', 'default']\n" | |
| 240 | 240 | "sys._xoptions: {'not_an_option': '1', 'also_not_an_option': '2'}\n" | |
@@ -249,7 +249,7 @@ def test_bpo20891(self): | |||
| 249 | 249 | calling PyEval_InitThreads() must not crash. PyGILState_Ensure() must | |
| 250 | 250 | call PyEval_InitThreads() for us in this case. | |
| 251 | 251 | """ | |
| 252 | - out, err = self.run_embedded_interpreter("bpo20891") | ||
| 252 | + out, err = self.run_embedded_interpreter("test_bpo20891") | ||
| 253 | 253 | self.assertEqual(out, '') | |
| 254 | 254 | self.assertEqual(err, '') | |
| 255 | 255 | ||
@@ -258,20 +258,20 @@ def test_initialize_twice(self): | |||
| 258 | 258 | bpo-33932: Calling Py_Initialize() twice should do nothing (and not | |
| 259 | 259 | crash!). | |
| 260 | 260 | """ | |
| 261 | - out, err = self.run_embedded_interpreter("initialize_twice") | ||
| 261 | + out, err = self.run_embedded_interpreter("test_initialize_twice") | ||
| 262 | 262 | self.assertEqual(out, '') | |
| 263 | 263 | self.assertEqual(err, '') | |
| 264 | 264 | ||
| 265 | 265 | def test_initialize_pymain(self): | |
| 266 | 266 | """ | |
| 267 | 267 | bpo-34008: Calling Py_Main() after Py_Initialize() must not fail. | |
| 268 | 268 | """ | |
| 269 | - out, err = self.run_embedded_interpreter("initialize_pymain") | ||
| 269 | + out, err = self.run_embedded_interpreter("test_initialize_pymain") | ||
| 270 | 270 | self.assertEqual(out.rstrip(), "Py_Main() after Py_Initialize: sys.argv=['-c', 'arg2']") | |
| 271 | 271 | self.assertEqual(err, '') | |
| 272 | 272 | ||
| 273 | 273 | def test_run_main(self): | |
| 274 | - out, err = self.run_embedded_interpreter("run_main") | ||
| 274 | + out, err = self.run_embedded_interpreter("test_run_main") | ||
| 275 | 275 | self.assertEqual(out.rstrip(), "_Py_RunMain(): sys.argv=['-c', 'arg2']") | |
| 276 | 276 | self.assertEqual(err, '') | |
| 277 | 277 | ||
@@ -632,13 +632,13 @@ def check_config(self, testname, expected_config=None, | |||
| 632 | 632 | self.check_global_config(config) | |
| 633 | 633 | ||
| 634 | 634 | 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) | ||
| 636 | 636 | ||
| 637 | 637 | 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) | ||
| 639 | 639 | ||
| 640 | 640 | 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) | ||
| 642 | 642 | ||
| 643 | 643 | def test_init_global_config(self): | |
| 644 | 644 | preconfig = { | |
@@ -660,7 +660,7 @@ def test_init_global_config(self): | |||
| 660 | 660 | 'user_site_directory': 0, | |
| 661 | 661 | 'pathconfig_warnings': 0, | |
| 662 | 662 | } | |
| 663 | - self.check_config("init_global_config", config, preconfig, | ||
| 663 | + self.check_config("test_init_global_config", config, preconfig, | ||
| 664 | 664 | api=API_COMPAT) | |
| 665 | 665 | ||
| 666 | 666 | def test_init_from_config(self): | |
@@ -705,7 +705,7 @@ def test_init_from_config(self): | |||
| 705 | 705 | 'check_hash_pycs_mode': 'always', | |
| 706 | 706 | 'pathconfig_warnings': 0, | |
| 707 | 707 | } | |
| 708 | - self.check_config("init_from_config", config, preconfig, | ||
| 708 | + self.check_config("test_init_from_config", config, preconfig, | ||
| 709 | 709 | api=API_COMPAT) | |
| 710 | 710 | ||
| 711 | 711 | def test_init_env(self): | |
@@ -732,23 +732,23 @@ def test_init_env(self): | |||
| 732 | 732 | 'faulthandler': 1, | |
| 733 | 733 | 'warnoptions': ['EnvVar'], | |
| 734 | 734 | } | |
| 735 | - self.check_config("init_env", config, preconfig, | ||
| 735 | + self.check_config("test_init_env", config, preconfig, | ||
| 736 | 736 | api=API_COMPAT) | |
| 737 | 737 | ||
| 738 | 738 | def test_init_env_dev_mode(self): | |
| 739 | 739 | preconfig = dict(allocator=PYMEM_ALLOCATOR_DEBUG) | |
| 740 | 740 | config = dict(dev_mode=1, | |
| 741 | 741 | faulthandler=1, | |
| 742 | 742 | warnoptions=['default']) | |
| 743 | - self.check_config("init_env_dev_mode", config, preconfig, | ||
| 743 | + self.check_config("test_init_env_dev_mode", config, preconfig, | ||
| 744 | 744 | api=API_COMPAT) | |
| 745 | 745 | ||
| 746 | 746 | def test_init_env_dev_mode_alloc(self): | |
| 747 | 747 | preconfig = dict(allocator=PYMEM_ALLOCATOR_MALLOC) | |
| 748 | 748 | config = dict(dev_mode=1, | |
| 749 | 749 | faulthandler=1, | |
| 750 | 750 | 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, | ||
| 752 | 752 | api=API_COMPAT) | |
| 753 | 753 | ||
| 754 | 754 | def test_init_dev_mode(self): | |
@@ -760,7 +760,7 @@ def test_init_dev_mode(self): | |||
| 760 | 760 | 'dev_mode': 1, | |
| 761 | 761 | 'warnoptions': ['default'], | |
| 762 | 762 | } | |
| 763 | - self.check_config("init_dev_mode", config, preconfig, | ||
| 763 | + self.check_config("test_init_dev_mode", config, preconfig, | ||
| 764 | 764 | api=API_PYTHON) | |
| 765 | 765 | ||
| 766 | 766 | def test_preinit_parse_argv(self): | |
@@ -777,7 +777,7 @@ def test_preinit_parse_argv(self): | |||
| 777 | 777 | 'warnoptions': ['default'], | |
| 778 | 778 | 'xoptions': ['dev'], | |
| 779 | 779 | } | |
| 780 | - self.check_config("preinit_parse_argv", config, preconfig, | ||
| 780 | + self.check_config("test_preinit_parse_argv", config, preconfig, | ||
| 781 | 781 | api=API_PYTHON) | |
| 782 | 782 | ||
| 783 | 783 | def test_preinit_dont_parse_argv(self): | |
@@ -790,7 +790,7 @@ def test_preinit_dont_parse_argv(self): | |||
| 790 | 790 | "-X", "dev", "-X", "utf8", "script.py"], | |
| 791 | 791 | 'isolated': 0, | |
| 792 | 792 | } | |
| 793 | - self.check_config("preinit_dont_parse_argv", config, preconfig, | ||
| 793 | + self.check_config("test_preinit_dont_parse_argv", config, preconfig, | ||
| 794 | 794 | api=API_ISOLATED) | |
| 795 | 795 | ||
| 796 | 796 | def test_init_isolated_flag(self): | |
@@ -799,7 +799,7 @@ def test_init_isolated_flag(self): | |||
| 799 | 799 | 'use_environment': 0, | |
| 800 | 800 | 'user_site_directory': 0, | |
| 801 | 801 | } | |
| 802 | - self.check_config("init_isolated_flag", config, api=API_PYTHON) | ||
| 802 | + self.check_config("test_init_isolated_flag", config, api=API_PYTHON) | ||
| 803 | 803 | ||
| 804 | 804 | def test_preinit_isolated1(self): | |
| 805 | 805 | # _PyPreConfig.isolated=1, _PyCoreConfig.isolated not set | |
@@ -808,7 +808,7 @@ def test_preinit_isolated1(self): | |||
| 808 | 808 | 'use_environment': 0, | |
| 809 | 809 | 'user_site_directory': 0, | |
| 810 | 810 | } | |
| 811 | - self.check_config("preinit_isolated1", config, api=API_COMPAT) | ||
| 811 | + self.check_config("test_preinit_isolated1", config, api=API_COMPAT) | ||
| 812 | 812 | ||
| 813 | 813 | def test_preinit_isolated2(self): | |
| 814 | 814 | # _PyPreConfig.isolated=0, _PyCoreConfig.isolated=1 | |
@@ -817,32 +817,35 @@ def test_preinit_isolated2(self): | |||
| 817 | 817 | 'use_environment': 0, | |
| 818 | 818 | 'user_site_directory': 0, | |
| 819 | 819 | } | |
| 820 | - self.check_config("preinit_isolated2", config, api=API_COMPAT) | ||
| 820 | + self.check_config("test_preinit_isolated2", config, api=API_COMPAT) | ||
| 821 | 821 | ||
| 822 | 822 | 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) | ||
| 824 | 824 | ||
| 825 | 825 | 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) | ||
| 827 | 830 | ||
| 828 | 831 | 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) | ||
| 830 | 833 | ||
| 831 | 834 | def test_init_dont_configure_locale(self): | |
| 832 | 835 | # _PyPreConfig.configure_locale=0 | |
| 833 | 836 | preconfig = { | |
| 834 | 837 | 'configure_locale': 0, | |
| 835 | 838 | 'coerce_c_locale': 0, | |
| 836 | 839 | } | |
| 837 | - self.check_config("init_dont_configure_locale", {}, preconfig, | ||
| 840 | + self.check_config("test_init_dont_configure_locale", {}, preconfig, | ||
| 838 | 841 | api=API_PYTHON) | |
| 839 | 842 | ||
| 840 | 843 | def test_init_read_set(self): | |
| 841 | 844 | core_config = { | |
| 842 | 845 | 'program_name': './init_read_set', | |
| 843 | 846 | 'executable': 'my_executable', | |
| 844 | 847 | } | |
| 845 | - self.check_config("init_read_set", core_config, | ||
| 848 | + self.check_config("test_init_read_set", core_config, | ||
| 846 | 849 | api=API_PYTHON, | |
| 847 | 850 | add_path="init_read_set_path") | |
| 848 | 851 | ||
@@ -855,7 +858,7 @@ def test_init_run_main(self): | |||
| 855 | 858 | 'run_command': code + '\n', | |
| 856 | 859 | 'parse_argv': 1, | |
| 857 | 860 | } | |
| 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) | ||
| 859 | 862 | ||
| 860 | 863 | def test_init_main(self): | |
| 861 | 864 | code = ('import _testinternalcapi, json; ' | |
@@ -867,7 +870,7 @@ def test_init_main(self): | |||
| 867 | 870 | 'parse_argv': 1, | |
| 868 | 871 | '_init_main': 0, | |
| 869 | 872 | } | |
| 870 | - self.check_config("init_main", core_config, | ||
| 873 | + self.check_config("test_init_main", core_config, | ||
| 871 | 874 | api=API_PYTHON, | |
| 872 | 875 | stderr="Run Python code before _Py_InitializeMain") | |
| 873 | 876 | ||
@@ -879,7 +882,7 @@ def test_init_parse_argv(self): | |||
| 879 | 882 | 'run_command': 'pass\n', | |
| 880 | 883 | 'use_environment': 0, | |
| 881 | 884 | } | |
| 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) | ||
| 883 | 886 | ||
| 884 | 887 | def test_init_dont_parse_argv(self): | |
| 885 | 888 | pre_config = { | |
@@ -890,7 +893,7 @@ def test_init_dont_parse_argv(self): | |||
| 890 | 893 | 'argv': ['./argv0', '-E', '-c', 'pass', 'arg1', '-v', 'arg3'], | |
| 891 | 894 | 'program_name': './argv0', | |
| 892 | 895 | } | |
| 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, | ||
| 894 | 897 | api=API_PYTHON) | |
| 895 | 898 | ||
| 896 | 899 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1243,39 +1243,39 @@ struct TestCase | |||
| 1243 | 1243 | }; | |
| 1244 | 1244 | ||
| 1245 | 1245 | static struct TestCase TestCases[] = { | |
| 1246 | - { "forced_io_encoding", test_forced_io_encoding }, | ||
| 1247 | - { "repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters }, | ||
| 1248 | - { "pre_initialization_api", test_pre_initialization_api }, | ||
| 1249 | - { "pre_initialization_sys_options", test_pre_initialization_sys_options }, | ||
| 1250 | - { "bpo20891", test_bpo20891 }, | ||
| 1251 | - { "initialize_twice", test_initialize_twice }, | ||
| 1252 | - { "initialize_pymain", test_initialize_pymain }, | ||
| 1253 | - { "init_initialize_config", test_init_initialize_config }, | ||
| 1254 | - { "preinit_compat_config", test_preinit_compat_config }, | ||
| 1255 | - { "init_compat_config", test_init_compat_config }, | ||
| 1256 | - { "init_global_config", test_init_global_config }, | ||
| 1257 | - { "init_from_config", test_init_from_config }, | ||
| 1258 | - { "init_parse_argv", test_init_parse_argv }, | ||
| 1259 | - { "init_dont_parse_argv", test_init_dont_parse_argv }, | ||
| 1260 | - { "init_env", test_init_env }, | ||
| 1261 | - { "init_env_dev_mode", test_init_env_dev_mode }, | ||
| 1262 | - { "init_env_dev_mode_alloc", test_init_env_dev_mode_alloc }, | ||
| 1263 | - { "init_dont_configure_locale", test_init_dont_configure_locale }, | ||
| 1264 | - { "init_dev_mode", test_init_dev_mode }, | ||
| 1265 | - { "init_isolated_flag", test_init_isolated_flag }, | ||
| 1266 | - { "preinit_isolated_config", test_preinit_isolated_config }, | ||
| 1267 | - { "init_isolated_config", test_init_isolated_config }, | ||
| 1268 | - { "preinit_python_config", test_preinit_python_config }, | ||
| 1269 | - { "init_python_config", test_init_python_config }, | ||
| 1270 | - { "preinit_isolated1", test_preinit_isolated1 }, | ||
| 1271 | - { "preinit_isolated2", test_preinit_isolated2 }, | ||
| 1272 | - { "preinit_parse_argv", test_preinit_parse_argv }, | ||
| 1273 | - { "preinit_dont_parse_argv", test_preinit_dont_parse_argv }, | ||
| 1274 | - { "init_read_set", test_init_read_set }, | ||
| 1275 | - { "init_run_main", test_init_run_main }, | ||
| 1276 | - { "init_main", test_init_main }, | ||
| 1277 | - { "run_main", test_run_main }, | ||
| 1278 | - { NULL, NULL } | ||
| 1246 | + {"test_forced_io_encoding", test_forced_io_encoding}, | ||
| 1247 | + {"test_repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters}, | ||
| 1248 | + {"test_pre_initialization_api", test_pre_initialization_api}, | ||
| 1249 | + {"test_pre_initialization_sys_options", test_pre_initialization_sys_options}, | ||
| 1250 | + {"test_bpo20891", test_bpo20891}, | ||
| 1251 | + {"test_initialize_twice", test_initialize_twice}, | ||
| 1252 | + {"test_initialize_pymain", test_initialize_pymain}, | ||
| 1253 | + {"test_init_initialize_config", test_init_initialize_config}, | ||
| 1254 | + {"test_preinit_compat_config", test_preinit_compat_config}, | ||
| 1255 | + {"test_init_compat_config", test_init_compat_config}, | ||
| 1256 | + {"test_init_global_config", test_init_global_config}, | ||
| 1257 | + {"test_init_from_config", test_init_from_config}, | ||
| 1258 | + {"test_init_parse_argv", test_init_parse_argv}, | ||
| 1259 | + {"test_init_dont_parse_argv", test_init_dont_parse_argv}, | ||
| 1260 | + {"test_init_env", test_init_env}, | ||
| 1261 | + {"test_init_env_dev_mode", test_init_env_dev_mode}, | ||
| 1262 | + {"test_init_env_dev_mode_alloc", test_init_env_dev_mode_alloc}, | ||
| 1263 | + {"test_init_dont_configure_locale", test_init_dont_configure_locale}, | ||
| 1264 | + {"test_init_dev_mode", test_init_dev_mode}, | ||
| 1265 | + {"test_init_isolated_flag", test_init_isolated_flag}, | ||
| 1266 | + {"test_preinit_isolated_config", test_preinit_isolated_config}, | ||
| 1267 | + {"test_init_isolated_config", test_init_isolated_config}, | ||
| 1268 | + {"test_preinit_python_config", test_preinit_python_config}, | ||
| 1269 | + {"test_init_python_config", test_init_python_config}, | ||
| 1270 | + {"test_preinit_isolated1", test_preinit_isolated1}, | ||
| 1271 | + {"test_preinit_isolated2", test_preinit_isolated2}, | ||
| 1272 | + {"test_preinit_parse_argv", test_preinit_parse_argv}, | ||
| 1273 | + {"test_preinit_dont_parse_argv", test_preinit_dont_parse_argv}, | ||
| 1274 | + {"test_init_read_set", test_init_read_set}, | ||
| 1275 | + {"test_init_run_main", test_init_run_main}, | ||
| 1276 | + {"test_init_main", test_init_main}, | ||
| 1277 | + {"test_run_main", test_run_main}, | ||
| 1278 | + {NULL, NULL} | ||
| 1279 | 1279 | }; | |
| 1280 | 1280 | ||
| 1281 | 1281 | int main(int argc, char *argv[]) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments