
    Bwg                         d Z ddlZddlZddlmZ ej                  j                   eej                  d       d      Z
 G d d      Zy)	z"
Check the numpy config is valid.
    N)patch_built_with_mesonzRequires Meson builds)reasonc                   B    e Zd Zg dZ ed      d        Zd Zd Zd Zy)TestNumPyConfigs)	CompilerszMachine InformationzPython Informationznumpy.__config__._check_pyyamlc                     t               |_        t        j                  t              5  t        j                          d d d        y # 1 sw Y   y xY wN)ModuleNotFoundErrorside_effectpytestwarnsUserWarningnpshow_config)selfmock_yaml_importers     T/var/www/horilla/myenv/lib/python3.12/site-packages/numpy/tests/test_numpy_config.pytest_pyyaml_not_foundz&TestNumPyConfigs.test_pyyaml_not_found   s9    )<)>&\\+& 	NN	 	 	s   AAc                     t        j                  d      t        t              sJ t	        fd| j
                  D              sJ d       y )Ndictsmodec              3   &   K   | ]  }|v  
 y wr
    ).0keyconfigs     r   	<genexpr>z2TestNumPyConfigs.test_dict_mode.<locals>.<genexpr>   s     FS3&=Fs   zFRequired key missing, see index of `False` with `REQUIRED_CONFIG_KEYS`)r   r   
isinstancedictallREQUIRED_CONFIG_KEYS)r   r   s    @r   test_dict_modezTestNumPyConfigs.test_dict_mode   sH    W-&$'''FD,E,EFF 	
@	
F    c                     t        j                  t              5  t        j                  d       d d d        y # 1 sw Y   y xY w)Nfoor   )r   raisesAttributeErrorr   r   r   s    r   test_invalid_modez"TestNumPyConfigs.test_invalid_mode$   s/    ]]>* 	'NN&	' 	' 	's	   :Ac                 ^    t        t        j                  j                        dk(  sJ d       y )N   zGNew mode detected, please add UT if applicable and increment this count)lenr   
__config__DisplayModesr*   s    r   test_warn_to_add_testsz'TestNumPyConfigs.test_warn_to_add_tests(   s,    2==--.!3 	
D	
3r%   N)	__name__
__module____qualname__r#   r   r   r$   r+   r1   r   r%   r   r   r      s3     +, -

'
r%   r   )__doc__numpyr   r   unittest.mockr   markskipifhasattrr/   
pytestmarkr   r   r%   r   <module>r<      sM      [[233"   

 
r%   