MCPcopy Index your code
hub / github.com/python/cpython / check_config

Method check_config

Lib/test/test_embed.py:908–924  ·  view source on GitHub ↗
(self, configs, expected)

Source from the content-addressed store, hash-verified

906 self.assertEqual(pre_config, expected)
907
908 def check_config(self, configs, expected):
909 config = dict(configs['config'])
910 if MS_WINDOWS:
911 value = config.get(key := 'program_name')
912 if value and isinstance(value, str):
913 value = value[:len(value.lower().removesuffix('.exe'))]
914 if debug_build(sys.executable):
915 value = value[:len(value.lower().removesuffix('_d'))]
916 config[key] = value
917 for key, value in list(expected.items()):
918 if value is self.IGNORE_CONFIG:
919 config.pop(key, None)
920 del expected[key]
921 # Resolve bool/int mismatches to reduce noise in diffs
922 if isinstance(value, (bool, int)) and isinstance(config.get(key), (bool, int)):
923 expected[key] = type(config[key])(expected[key])
924 self.assertEqual(config, expected)
925
926 def check_global_config(self, configs):
927 pre_config = configs['pre_config']

Callers 1

check_all_configsMethod · 0.95

Calls 8

debug_buildFunction · 0.85
listClass · 0.85
getMethod · 0.45
removesuffixMethod · 0.45
lowerMethod · 0.45
itemsMethod · 0.45
popMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected