관리-도구
편집 파일: test_warnings.cpython-311.pyc
� �܋f� � � � d Z ddlZddlmZ ddlZddlZddlZ G d� dej � � Z G d� dej � � Z ej j d� � � ZdS ) z Tests which scan for certain occurrences in the code, they may not find all of these occurrences but should catch almost all. � N)�Pathc � � e Zd Zd� Zd� Zd� ZdS )� ParseCallc � � g | _ d S �N)�ls)�selfs �l/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/numpy/tests/test_warnings.py�__init__zParseCall.__init__ s � ������ c � � t j � | |� � | j � |j � � d S r )�ast�NodeVisitor� generic_visitr �append�attr�r �nodes r �visit_AttributezParseCall.visit_Attribute s6 � ���%�%�d�D�1�1�1�����t�y�!�!�!�!�!r c �D � | j � |j � � d S r )r r �idr s r � visit_NamezParseCall.visit_Name s � �����t�w�����r N)�__name__� __module__�__qualname__r r r � r r r r sA � � � � � �� � �"� "� "� � � � � r r c �$ � � e Zd Z� fd�Zd� Z� xZS )� FindFuncsc �V �� t � � � � � || _ d S r )�superr �_FindFuncs__filename)r �filename� __class__s �r r zFindFuncs.__init__ s$ �� � ��������"����r c � � t � � }|� |j � � t j � | |� � |j d dk s|j d dk rC|j d j dk r-t d� | j |j � � � � �|j d dk r�t |j � � dk s|j d d k rmd| j k rd S t |j � � dk rd S d � |j D � � }d|v rd S t d� | j |j � � � � �d S d S )N����simplefilter�filterwarningsr �ignorezFwarnings should have an appropriate stacklevel; found in {} on line {}�warn� ����warningsztesting/tests/test_warnings.py� c � � h | ] }|j �� S r )�arg)�.0�kws r � <setcomp>z'FindFuncs.visit_Call.<locals>.<setcomp>2 s � �3�3�3�r�B�F�3�3�3r � stacklevel)r �visit�funcr r r r �args�s�AssertionError�formatr! �lineno�len�keywords)r r �pr6 s r � visit_CallzFindFuncs.visit_Call sY � ��K�K�� ���� ������%�%�d�D�1�1�1��4��8�~�%�%���b��5E�)E�)E��y��|�~��)�)�$�$�$*�F�4�?�D�K�$H�$H�J� J� J� �4��8�v����A�D� � �Q���!�$�r�(�j�"8�"8�/�4�?�B�B��� �4�9�~�~��"�"���3�3�T�]�3�3�3�D��t�#�#��� � � &��t���� D� D�F� F� F� ��"8�"8r )r r r r r>