o
    Ô­jÙ  ã                   @   sP   d Z ddlZddlZddlmZmZ ejje	ej
dƒ dd�ZG dd„ dƒZdS )	z"
Check the numpy config is valid.
é    N)ÚMockÚpatchÚ_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 )ÚTestNumPyConfigs)Ú	CompilerszMachine InformationzPython Informationznumpy.__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ÚnpÚshow_config)ÚselfÚmock_yaml_importer© r   úZ/var/www/html/CropPilot/venv/lib/python3.10/site-packages/numpy/tests/test_numpy_config.pyÚtest_pyyaml_not_found   s   
"ÿz&TestNumPyConfigs.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    z3TestNumPyConfigs.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TestNumPyConfigs.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"TestNumPyConfigs.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'TestNumPyConfigs.test_warn_to_add_testsN)	Ú__name__Ú
__module__Ú__qualname__r   r   r   r!   r%   r*   r   r   r   r   r      s    
	r   )Ú__doc__Únumpyr   r
   Úunittest.mockr   r   ÚmarkÚskipifÚhasattrr(   Ú
pytestmarkr   r   r   r   r   Ú<module>   s    þ