
    J/Ph                     ~    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dS )    N)types)TestCasetemp_directory)inspect_functioninspect_modulec                   .    e Zd ZddZd Zd Zd Zd ZdS )	TestInspectorFc                    |                      |t                     |                     d|           |d         }||                     |           d S |                      |t          j                   |                     d|           |                      |d         t                     |                     d|           |                      |d         t                     d S )N
numba_type	explainedsource_infos)assertIsInstancedictassertInassertFalser   Typestr)selfinfomust_be_definedr   s       U/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/tests/test_help.pycheck_function_descriptorz'TestInspector.check_function_descriptor   s    dD)))lD))),'
_-----!!*ej999MM+t,,,!!${"3S999MM.$///!!$~"6=====    c                 \    t          t                    }|                     |d           d S )NTr   )r   ranger   )r   r   s     r   test_inspect_function_on_rangez,TestInspector.test_inspect_function_on_range   s.    &&&&tT&BBBBBr   c                    t          t          j                  }|                     |d           |d         }|                     t          |          d           d}|                                D ]}|                     |d         t                     |                     |d         t                     |                     |d         t                     |                     |d         t                     |                     |d	         t                     | 
                    d
|           |dz  }|                     |t          |                     d S )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    s9   ''&&tT&BBBN+3|,,a000#**,, 	 	G!!'&/3777!!'&/3777!!'%.#666!!'*"5s;;;!!''"2E:::MM+w///FAAC--.....r   c                 v   d}t          t                    D ]}|                     |d         t          j                   |                     |d         t
                     |                     t          |d                              |                     |           |dz  }| 	                    |d           d S )Nr   moduler    objr%   )
r   builtinsr   pytypes
ModuleTyper   
assertTruecallabler   r(   )r   r-   its      r   test_inspect_modulez!TestInspector.test_inspect_module0   s     ** 	 	B!!"X,0BCCC!!"V*c222OOHRY//000**2...FAA1a     r   c                    t           j        ddg}t          d                    t          | j        j                            }t          j                            |d          }|dz   }|d|dgz   }| 	                    t          j        
                    |                     t          j        |           |                     t          j        
                    |                     |d|dd	dgz   }|d
z   }| 	                    t          j        
                    |                     t          j        |           |                     t          j        
                    |                     |d|dddgz   }|                     t          j                  5 }t          j        |t          j                   d d d            n# 1 swxY w Y   |                     d|j        j                                                   d S )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0G"I "I J J7<<// !7*(Hf5566777%%%}55666 (Hj%HH 6)66777%%%}55666 (Hj%HHz<== 	D#D1BCCCC	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D0&-4466	8 	8 	8 	8 	8s   !GGGN)F)rC   
__module____qualname__r   r   r/   r9   rV    r   r   r	   r	      sg        > > > >C C C/ / / ! ! !"8 "8 "8 "8 "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 8 8 8 8 8 8 8 F F F F F F F FN8 N8 N8 N8 N8H N8 N8 N8 N8 N8r   