o
    "g*	                     @   sh   d Z ddlZddlmZ ddlZddlZddlZG dd dejZG dd dejZ	ej
jdd	 ZdS )
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 Zd Zdd Zdd Zdd ZdS )	ParseCallc                 C   s
   g | _ d S N)ls)self r   [/var/www/html/ecg_monitoring/venv/lib/python3.10/site-packages/numpy/tests/test_warnings.py__init__   s   
zParseCall.__init__c                 C   s    t j| | | j|j d S r   )astNodeVisitorgeneric_visitr   appendattrr   noder   r   r   visit_Attribute   s   zParseCall.visit_Attributec                 C   s   | j |j d S r   )r   r   idr   r   r   r   
visit_Name   s   zParseCall.visit_NameN)__name__
__module____qualname__r	   r   r   r   r   r   r   r      s    r   c                       s$   e Zd Z fddZdd Z  ZS )	FindFuncsc                    s   t    || _d S r   )superr	   _FindFuncs__filename)r   filename	__class__r   r   r	      s   

zFindFuncs.__init__c                 C   s   t  }||j tj| | |jd dks|jd dkr0|jd jdkr0t	d
| j|j|jd dkrmt|jdksE|jd	 d
krod| jkrLd S t|jdkrUd S dd |jD }d|v rcd S t	d
| j|jd S d S )Nsimplefilterfilterwarningsr   ignorezFwarnings should have an appropriate stacklevel; found in {} on line {}warn   warningsztesting/tests/test_warnings.py   c                 S   s   h | ]}|j qS r   )arg).0kwr   r   r   	<setcomp>2   s    z'FindFuncs.visit_Call.<locals>.<setcomp>
stacklevel)r   visitfuncr
   r   r   r   argsvalueAssertionErrorformatr   linenolenkeywords)r   r   pr-   r   r   r   
visit_Call   s0   
zFindFuncs.visit_Call)r   r   r   r	   r5   __classcell__r   r   r   r   r      s    r   c               	   C   s   t tjj} | dD ]F}| d |jv rq|| d krq|| d d kr%q|| d kr,qtt|}t	
| }t|| W d    n1 sLw   Y  qd S )Nz*.pytestingz__init__.pyrandomzconftest.py)r   numpy__file__parentrglobparentstokenizeopenstrr
   parsereadr   r+   )basepathfiletreer   r   r   test_warning_calls:   s    rG   )__doc__pytestpathlibr   r
   r>   r9   r   r   r   markslowrG   r   r   r   r   <module>   s    "