o
    i                     @   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)patchZ_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)Z	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)ModuleNotFoundErrorZside_effectpytestZwarnsUserWarningscipyshow_config)selfZmock_yaml_importer r   V/home/kim/smarthome/.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 )NZ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 )NZfoor   )r   Z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__ZDisplayModesr   r   r   r   test_warn_to_add_tests)   s   z'TestSciPyConfigs.test_warn_to_add_testsN)__name__
__module____qualname__r   r   markZthread_unsafer   r   r   r   r    r   r   r   r   r      s    	r   )__doc__r   r   Zunittest.mockr   r$   Zskipifhasattrr   Z
pytestmarkr   r   r   r   r   <module>   s    