o
    Ö­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)ÚpatchÚ_built_with_mesonzRequires Meson builds)Úreasonc                   @   sD   e Zd Zg d¢Zejjedƒdd„ ƒƒZdd„ Z	dd„ Z
d	d
„ ZdS )ÚTestSciPyConfigs)Ú	CompilerszMachine InformationzPython Informationzscipy.__config__._check_pyyamlc                 C   s@   t ƒ |_t t¡� t ¡  W d   ƒ d S 1 sw   Y  d S )N)ÚModuleNotFoundErrorÚside_effectÚpytestÚwarnsÚUserWarningÚscipyÚshow_config)ÚselfÚmock_yaml_importer© r   úY/var/www/html/CropPilot/venv/lib/python3.10/site-packages/scipy/_lib/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 )NÚdicts©Úmodec                    s   g | ]}|ˆ v ‘qS r   r   )Ú.0Úkey©Úconfigr   r   Ú
<listcomp>    s    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   ƒ d S 1 sw   Y  d S )NÚfoor   )r	   Ú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__ÚDisplayModesr   r   r   r   Útest_warn_to_add_tests)   s   ÿz'TestSciPyConfigs.test_warn_to_add_testsN)Ú__name__Ú
__module__Ú__qualname__r   r	   ÚmarkÚthread_unsafer   r   r    r$   r)   r   r   r   r   r      s    	r   )Ú__doc__r   r	   Úunittest.mockr   r-   ÚskipifÚhasattrr'   Ú
pytestmarkr   r   r   r   r   Ú<module>   s    þ