(self, testname, expected_config=None,
expected_preconfig=None,
modify_path_cb=None,
stderr=None, *, api, preconfig_api=None,
env=None, ignore_stderr=False, cwd=None)
| 946 | self.assertEqual(configs['global_config'], expected) |
| 947 | |
| 948 | def check_all_configs(self, testname, expected_config=None, |
| 949 | expected_preconfig=None, |
| 950 | modify_path_cb=None, |
| 951 | stderr=None, *, api, preconfig_api=None, |
| 952 | env=None, ignore_stderr=False, cwd=None): |
| 953 | new_env = remove_python_envvars() |
| 954 | if env is not None: |
| 955 | new_env.update(env) |
| 956 | env = new_env |
| 957 | |
| 958 | if preconfig_api is None: |
| 959 | preconfig_api = api |
| 960 | if preconfig_api == API_ISOLATED: |
| 961 | default_preconfig = self.PRE_CONFIG_ISOLATED |
| 962 | elif preconfig_api == API_PYTHON: |
| 963 | default_preconfig = self.PRE_CONFIG_PYTHON |
| 964 | else: |
| 965 | default_preconfig = self.PRE_CONFIG_COMPAT |
| 966 | if expected_preconfig is None: |
| 967 | expected_preconfig = {} |
| 968 | expected_preconfig = dict(default_preconfig, **expected_preconfig) |
| 969 | |
| 970 | if expected_config is None: |
| 971 | expected_config = {} |
| 972 | |
| 973 | if api == API_PYTHON: |
| 974 | default_config = self.CONFIG_PYTHON |
| 975 | elif api == API_ISOLATED: |
| 976 | default_config = self.CONFIG_ISOLATED |
| 977 | else: |
| 978 | default_config = self.CONFIG_COMPAT |
| 979 | expected_config = dict(default_config, **expected_config) |
| 980 | |
| 981 | self.get_expected_config(expected_preconfig, |
| 982 | expected_config, |
| 983 | env, |
| 984 | api, modify_path_cb) |
| 985 | |
| 986 | out, err = self.run_embedded_interpreter(testname, |
| 987 | env=env, cwd=cwd) |
| 988 | if stderr is None and not expected_config['verbose']: |
| 989 | stderr = "" |
| 990 | if stderr is not None and not ignore_stderr: |
| 991 | self.assertEqual(err.rstrip(), stderr) |
| 992 | try: |
| 993 | configs = json.loads(out) |
| 994 | except json.JSONDecodeError: |
| 995 | self.fail(f"fail to decode stdout: {out!r}") |
| 996 | |
| 997 | self.check_pre_config(configs, expected_preconfig) |
| 998 | self.check_config(configs, expected_config) |
| 999 | self.check_global_config(configs) |
| 1000 | return configs |
| 1001 | |
| 1002 | @unittest.skipIf(support.check_bolt_optimized, "segfaults on BOLT instrumented binaries") |
| 1003 | def test_init_default_config(self): |
no test coverage detected