a :jg@sPdZddlZddlZddlmZmZejje ej d ddZ GdddZ dS) z" Check the numpy config is valid. N)MockpatchZ_built_with_mesonzRequires Meson builds)reasonc@s<eZdZgdZedddZddZddZd d Zd S) TestNumPyConfigs)Z CompilerszMachine InformationzPython Informationznumpy.__config__._check_pyyamlcCs>t|_tttWdn1s00YdS)N)ModuleNotFoundErrorZ side_effectpytestZwarns UserWarningnp show_config)selfZmock_yaml_importerr G/usr/local/lib/python3.9/site-packages/numpy/tests/test_numpy_config.pytest_pyyaml_not_founds z&TestNumPyConfigs.test_pyyaml_not_foundcs>tjddttsJtfdd|jDs:JddS)NZdictsmodecsg|] }|vqSr r ).0keyconfigr r z3TestNumPyConfigs.test_dict_mode..zFRequired key missing, see index of `False` with `REQUIRED_CONFIG_KEYS`)r r isinstancedictallREQUIRED_CONFIG_KEYSr r rr test_dict_modes  zTestNumPyConfigs.test_dict_modecCs:tttjddWdn1s,0YdS)NZfoor)rZraisesAttributeErrorr r rr r r test_invalid_mode$s z"TestNumPyConfigs.test_invalid_modecCsttjjdksJddS)NzGNew mode detected, please add UT if applicable and increment this count)lenr __config__Z DisplayModesrr r r test_warn_to_add_tests(sz'TestNumPyConfigs.test_warn_to_add_testsN) __name__ __module__ __qualname__rrrrrr"r r r r rs   r) __doc__numpyr rZ unittest.mockrrmarkZskipifhasattrr!Z pytestmarkrr r r r s