← Back
Editing: test_config.cpython-311.pyc
� d�c� � � � d Z ddlZddlZddlmZ ej � eej d� � d�� � Z G d� d� � Z dS ) z" Check the SciPy config is valid. � N)�patch�_built_with_mesonzRequires Meson builds)�reasonc �P � e Zd Zg d�Z ed� � d� � � Zd� Zd� Zd� ZdS )�TestSciPyConfigs)� CompilerszMachine InformationzPython Informationzscipy.__config__._check_pyyamlc � � t � � |_ t j t � � 5 t j � � d d d � � d S # 1 swxY w Y d S )N)�ModuleNotFoundError�side_effect�pytest�warns�UserWarning�scipy�show_config)�self�mock_yaml_importers �>/usr/lib/python3/dist-packages/scipy/misc/tests/test_config.py�test_pyyaml_not_foundz&TestSciPyConfigs.test_pyyaml_not_found s� � �)<�)>�)>��&� �\�+� &� &� � ������ � � � � � � � � � � � ���� � � � � � s �A�A�Ac � �� t j d�� � �t �t � � sJ �t �fd�| j D � � � � s J d� � �d S )N�dicts��modec � �� g | ]}|�v ��S � r )�.0�key�configs �r � <listcomp>z3TestSciPyConfigs.test_dict_mode.<locals>.<listcomp> s �� �G�G�G�c�C�6�M�G�G�G� 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_modezTestSciPyConfigs.test_dict_mode sx �� ��"��0�0�0���&�$�'�'�'�'�'��G�G�G�G�T�-F�G�G�G�H�H� � � @� � � � � r c � � t j t � � 5 t j d�� � d d d � � d S # 1 swxY w Y d S )N�foor )r �raises�AttributeErrorr r �r s r �test_invalid_modez"TestSciPyConfigs.test_invalid_mode$ s� � � �]�>� *� *� *� *���5�)�)�)�)� *� *� *� *� *� *� *� *� *� *� *� *���� *� *� *� *� *� *s �=�A�Ac �^ � t t j j � � dk s J d� � �d S )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( s5 � ��5�#�0�1�1�Q�6�6�6� D� 7�6�6�6�6r N) �__name__� __module__�__qualname__r# r r r$ r* r0 r r r r r sz � � � � � �� � �� �U�+�,�,� � � -�,� � � � �*� *� *� � � � � r r )�__doc__r r � unittest.mockr �mark�skipif�hasattrr. � pytestmarkr r r r �<module>r: s� ��� � ���� � � � � � � � � � � �[� � ���� �"5�6�6�6�"� � � � � � � � � � � � � � r
Save File
Cancel