o
    i                     @   sp   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 deZdS )    N)types)TestCasetemp_directory)inspect_functioninspect_modulec                   @   s6   e Zd ZdddZdd Zdd Zdd	 Zd
d ZdS )TestInspectorFc                 C   s   |  |t | d| |d }|d u r| | 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    r   R/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/numba/tests/test_help.pycheck_function_descriptor   s   z'TestInspector.check_function_descriptorc                 C   s   t t}| j|dd d S )NTr   )r   ranger   )r   r   r   r   r   test_inspect_function_on_range   s   z,TestInspector.test_inspect_function_on_rangec                 C   s   t tj}| j|dd |d }| t|d d}| D ]4}| |d t | |d t | |d t | |d t | |d	 t	 | 
d
| |d7 }q| |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srcinfor   r   r   test_inspect_function_on_np_all    s   

z-TestInspector.test_inspect_function_on_np_allc                 C   sh   d}t tD ]%}| |d tj | |d t | t|d  | | |d7 }q| 	|d d S )Nr   moduler   objr    )
r   builtinsr   pytypes
ModuleTyper   
assertTruecallabler   r#   )r   r(   itr   r   r   test_inspect_module0   s   

z!TestInspector.test_inspect_modulec                 C   s   t jddg}tdt| jj}tj|d}|d }|d|dg }| 	tj
| t| | tj
| |d|dd	dg }|d
 }| 	tj
| t| | tj
| |d|dddg }| tj}tj|tjd W d    n1 s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_outputr0   assertRaisesCalledProcessErrorSTDOUTr   	exceptionstdoutdecode)r   cmdbasedirpathr   expected_filecmdsraisesr   r   r   test_inspect_cli:   s,   


zTestInspector.test_inspect_cliN)F)r<   
__module____qualname__r   r   r*   r3   rO   r   r   r   r   r      s    

r   )r9   rB   r   r.   os.pathr>   numpyr!   r-   
numba.corenumba.tests.supportr   r   numba.misc.help.inspectorr   r   r   r   r   r   r   <module>   s    