
    e!h                         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 SciPy config is valid.
    N)patch_built_with_mesonzRequires Meson builds)reasonc                   t    e Zd Zg dZej
                  j                   ed      d               Zd Z	d Z
d Zy)TestSciPyConfigs)	CompilerszMachine InformationzPython Informationzscipy.__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scipyshow_config)selfmock_yaml_importers     d/var/www/html/diagnosisapp-backend/venv/lib/python3.12/site-packages/scipy/_lib/tests/test_config.pytest_pyyaml_not_foundz&TestSciPyConfigs.test_pyyaml_not_found   s=     *=)>&\\+& 	 	  	  	 s   AAc                     t        j                  d      }t        |t              sJ t	        | j
                  D cg c]  }||v  c}      sJ d       y c c}w )NdictsmodezFRequired key missing, see index of `False` with `REQUIRED_CONFIG_KEYS`)r   r   
isinstancedictallREQUIRED_CONFIG_KEYS)r   configkeys      r   test_dict_modezTestSciPyConfigs.test_dict_mode   sU    ""0&$'''T-F-FGcC6MGH 	
@	
HGs   A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"TestSciPyConfigs.test_invalid_mode%   s1    ]]>* 	*5)	* 	* 	*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'TestSciPyConfigs.test_warn_to_add_tests)   s.    5##001Q6 	
D	
6    N)__name__
__module____qualname__r   r   markthread_unsafer   r   r   r%   r+    r,   r   r   r      sE     [[
+,  -  

*
r,   r   )__doc__r   r   unittest.mockr   r0   skipifhasattrr)   
pytestmarkr   r2   r,   r   <module>r8      sO      [[  "566"   

 
r,   