o
    h                     @   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 numpy config is valid.
    N)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   q/var/www/html/construction_image-detection-poc/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                 3   s    | ]}| v V  qd S r   r   ).0keyconfigr   r   	<genexpr>   s    z2TestNumPyConfigs.test_dict_mode.<locals>.<genexpr>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   markskipifhasattrr(   
pytestmarkr   r   r   r   r   <module>   s    