ó
ÿ¼÷Xc           @` sï   d  Z  d d l m Z m Z m Z d d l Z e j d k rë d d l m Z d d l	 Z	 d d l
 Z
 d d l Z d d l m Z d d l m Z d	 e	 j f d
 „  ƒ  YZ d e	 j f d „  ƒ  YZ e d „  ƒ Z e d k rë e ƒ  që n  d S(   s}   
Tests which scan for certain occurances in the code, they may not find
all of these occurances but should catch almost all.
i    (   t   divisiont   absolute_importt   print_functionNi   i   (   t   Path(   t   run_module_suite(   t   slowt	   ParseCallc           B` s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C` s   g  |  _  d  S(   N(   t   ls(   t   self(    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyt   __init__   s    c         C` s*   t  j j |  | ƒ |  j j | j ƒ d  S(   N(   t   astt   NodeVisitort   generic_visitR   t   appendt   attr(   R   t   node(    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyt   visit_Attribute   s    c         C` s   |  j  j | j ƒ d  S(   N(   R   R   t   id(   R   R   (    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyt
   visit_Name   s    (   t   __name__t
   __module__R	   R   R   (    (    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyR      s   		t	   FindFuncsc           B` s   e  Z d  „  Z d „  Z RS(   c         C` s   t  ƒ  j ƒ  | |  _ d  S(   N(   t   superR	   t   _FindFuncs__filename(   R   t   filename(    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyR	   !   s    c         C` s;  t  ƒ  } | j | j ƒ t j j |  | ƒ | j d d k sR | j d d k rŒ | j d j d k rŒ t	 d j
 |  j | j ƒ ƒ ‚ qŒ n  | j d d k r7t | j ƒ d k sÇ | j d	 d
 k r7d |  j k rÚ d  St | j ƒ d k ró d  Sd „  | j Dƒ } d | k rd  St	 d j
 |  j | j ƒ ƒ ‚ n  d  S(   Niÿÿÿÿt   simplefiltert   filterwarningsi    t   ignores8   ignore filter should not be used; found in {} on line {}t   warni   iþÿÿÿt   warningss   testing/tests/test_warnings.pyi   c         S` s   h  |  ] } | j  ’ q S(    (   t   arg(   t   .0t   kw(    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pys	   <setcomp>:   s   	 t
   stacklevelsF   warnings should have an appropriate stacklevel; found in {} on line {}(   R   t   visitt   funcR
   R   R   R   t   argst   st   AssertionErrort   formatR   t   linenot   lent   keywords(   R   R   t   pR$   (    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyt
   visit_Call%   s(    	&((   R   R   R	   R,   (    (    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyR       s   	c          C` s¿   t  t j ƒ j }  x¦ |  j d ƒ D]• } |  d | j k rA q" n  | |  d k rW q" n  | |  d d k rq q" n  t j t | ƒ ƒ / } t	 j
 | j ƒ  ƒ } t | ƒ j | ƒ Wd  QXq" Wd  S(   Ns   *.pyt   testings   __init__.pyt   random(   R   t   numpyt   __file__t   parentt   rglobt   parentst   tokenizet   opent   strR
   t   parset   readR   R"   (   t   baset   patht   filet   tree(    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyt   test_warning_callsB   s    t   __main__(   i   i   (   t   __doc__t
   __future__R    R   R   t   syst   version_infot   pathlibR   R
   R4   R/   t   numpy.testingR   t   numpy.testing.decoratorsR   R   R   R   R=   R   (    (    (    s8   /tmp/pip-build-2Vcwy8/numpy/numpy/tests/test_warnings.pyt   <module>   s   "