
    xKg                     v    d dl Z d dlZd dlZd dlZd dlZd dlZd dl	mZ d dl
mZmZ d dlmZmZ  G d de      Zy)    N)types)TestCasetemp_directory)inspect_functioninspect_modulec                   ,    e Zd ZddZd Zd Zd Zd Zy)TestInspectorc                 r   | j                  |t               | j                  d|       |d   }|| j                  |       y | j                  |t        j
                         | j                  d|       | j                  |d   t               | j                  d|       | j                  |d   t               y )N
numba_type	explainedsource_infos)assertIsInstancedictassertInassertFalser   Typestr)selfinfomust_be_definedr   s       Y/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/tests/test_help.pycheck_function_descriptorz'TestInspector.check_function_descriptor   s    dD)lD),'
_-!!*ejj9MM+t,!!${"3S9MM.$/!!$~"6=    c                 H    t        t              }| j                  |d       y )NTr   )r   ranger   )r   r   s     r   test_inspect_function_on_rangez,TestInspector.test_inspect_function_on_range   s    &&&tT&Br   c                 (   t        t        j                        }| j                  |d       |d   }| j	                  t        |      d       d}|j                         D ]  }| j                  |d   t               | j                  |d   t               | j                  |d   t               | j                  |d   t               | j                  |d	   t               | j                  d
|       |dz  } | j                  |t        |             y )NTr   r   r   kindnamesigfilenamelines	docstring   )r   npallr   assertGreaterlenvaluesr   r   tupler   assertEqual)r   r   r   csrcinfos        r   test_inspect_function_on_np_allz-TestInspector.test_inspect_function_on_np_all    s    '&&tT&BN+3|,a0#**,G!!'&/37!!'&/37!!'%.#6!!'*"5s;!!''"2E:MM+w/FA - 	C-.r   c                 2   d}t        t              D ]q  }| j                  |d   t        j                         | j                  |d   t
               | j                  t        |d                | j                  |       |dz  }s | j                  |d       y )Nr   moduler    objr%   )
r   builtinsr   pytypes
ModuleTyper   
assertTruecallabler   r(   )r   r-   its      r   test_inspect_modulez!TestInspector.test_inspect_module0   s     *B!!"X,0B0BC!!"V*c2OOHRY/0**2.FA + 	1a r   c                    t         j                  ddg}t        dj                  t        | j
                  j                              }t        j                  j                  |d      }|dz   }|d|dgz   }| j                  t        j                  j                  |             t        j                  |       | j                  t        j                  j                  |             |d|dd	dgz   }|d
z   }| j                  t        j                  j                  |             t        j                  |       | j                  t        j                  j                  |             |d|dddgz   }| j                  t        j                        5 }t        j                  |t        j                          d d d        | j#                  dj$                  j&                  j)                                y # 1 sw Y   >xY w)Nz-mznumba.misc.help.inspectorz{}.{}outz.htmlz--filemathz--formatrstz.rstfoo)stderrz'foo' is not supported)sys
executabler   format__name__	__class__ospathjoinr   isfile
subprocesscheck_outputr6   assertRaisesCalledProcessErrorSTDOUTr   	exceptionstdoutdecode)r   cmdbasedirpathr"   expected_filecmdsraisess          r   test_inspect_clizTestInspector.test_inspect_cli:   s   >>4)DE 040G0G"I J77<</ !7*(Hf5567%}56 (Hj%HH 6)67%}56 (Hj%HHz<<=##D1B1BC >0&&--446	8 >=s   &G11G:N)F)rC   
__module____qualname__r   r   r/   r9   rV    r   r   r	   r	      s    >C/ !"8r   r	   )r@   rI   r   r4   os.pathrE   numpyr&   r3   
numba.corenumba.tests.supportr   r   numba.misc.help.inspectorr   r   r	   rY   r   r   <module>r_      s.    
       8 FN8H N8r   