a
    ‡ù»j  ã                   @   sL   d Z ddlZddlZddlmZ ejjeejdƒ dd�Z	G dd„ dƒZ
dS )	z"
Check the SciPy config is valid.
é    N)ÚpatchZ_built_with_mesonzRequires Meson builds)Úreasonc                   @   s<   e Zd Zg d¢Zedƒdd„ ƒZdd„ Zdd„ Zd	d
„ ZdS )ÚTestSciPyConfigs)Z	CompilerszMachine InformationzPython Informationzscipy.__config__._check_pyyamlc                 C   s>   t ƒ |_t t¡� t ¡  W d   ƒ n1 s00    Y  d S )N)ÚModuleNotFoundErrorZside_effectÚpytestZwarnsÚUserWarningÚscipyÚshow_config)ÚselfZmock_yaml_importer© r   úBE:\soccer\ml_env\Lib\site-packages\scipy/misc/tests/test_config.pyÚtest_pyyaml_not_found   s    z&TestSciPyConfigs.test_pyyaml_not_foundc                    s>   t jdd�‰ tˆ tƒsJ ‚t‡ fdd„| jD ƒƒs:J dƒ‚d S )NZdicts©Úmodec                    s   g | ]}|ˆ v ‘qS r   r   )Ú.0Úkey©Úconfigr   r   Ú
<listcomp>   ó    z3TestSciPyConfigs.test_dict_mode.<locals>.<listcomp>zFRequired key missing, see index of `False` with `REQUIRED_CONFIG_KEYS`)r   r	   Ú
isinstanceÚdictÚallÚREQUIRED_CONFIG_KEYS©r
   r   r   r   Útest_dict_mode   s
    ÿzTestSciPyConfigs.test_dict_modec                 C   s:   t  t¡� tjdd� W d   ƒ n1 s,0    Y  d S )NZfoor   )r   ZraisesÚAttributeErrorr   r	   r   r   r   r   Útest_invalid_mode$   s    z"TestSciPyConfigs.test_invalid_modec                 C   s   t tjjƒdksJ dƒ‚d S )Né   zGNew mode detected, please add UT if applicable and increment this count)Úlenr   Ú
__config__ZDisplayModesr   r   r   r   Útest_warn_to_add_tests(   s    ÿz'TestSciPyConfigs.test_warn_to_add_testsN)	Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r!   r   r   r   r   r      s   
	r   )Ú__doc__r   r   Zunittest.mockr   ÚmarkZskipifÚhasattrr    Z
pytestmarkr   r   r   r   r   Ú<module>   s   þ