3
���h� � @ sh d Z ddlZddlmZ ddlZddlZddlZG dd� dej�ZG dd� dej�Z ej
jdd � �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 @ s$ e Zd Zdd� Zdd� Zdd� ZdS )� ParseCallc C s
g | _ d S )N)�ls)�self� r �:/tmp/pip-build-5_djhm0z/numpy/numpy/tests/test_warnings.py�__init__
s zParseCall.__init__c C s t jj| |� | jj|j� d S )N)�ast�NodeVisitor�
generic_visitr �append�attr)r �noder r r �visit_Attribute s zParseCall.visit_Attributec C s | j j|j� d S )N)r r �id)r r r r r �
visit_Name s zParseCall.visit_NameN)�__name__�
__module__�__qualname__r r r r r r r r s r c s$ e Zd Z� fdd�Zdd� Z� ZS )� FindFuncsc s t � j� || _d S )N)�superr �_FindFuncs__filename)r �filename)� __class__r r r s
zFindFuncs.__init__c C s� t � }|j|j� tjj| |� |jd dks<|jd dkr`|jd jdkr`t dj
| j|j���|jd dkr�t
|j�dks�|jd d kr�d
| jkr�d S t
|j�dkr�d S dd
� |jD �}d|kr�d S t dj
| j|j���d S )N� �simplefilter�filterwarningsr �ignorezFwarnings should have an appropriate stacklevel; found in {} on line {}�warn� �warningsztesting/tests/test_warnings.py� c S s h | ]
}|j �qS r )�arg)�.0�kwr r r � <setcomp>2 s z'FindFuncs.visit_Call.<locals>.<setcomp>�
stacklevel���r' |