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_typeZ	explainedsource_infos)assertIsInstancedictassertInassertFalser   Typestr)selfinfomust_be_definedr    r   d/var/www/html/eduruby.in/lip-sync/lip-sync-env/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.rstZfoo)stderrz'foo' is not supported)sys
executabler   format__name__	__class__ospathjoinr   isfile
subprocesscheck_outputr/   assertRaisesCalledProcessErrorSTDOUTr   	exceptionstdoutdecode)r   Zcmdbasedirpathr   Zexpected_fileZcmdsZraisesr   r   r   test_inspect_cli:   s,   


zTestInspector.test_inspect_cliN)F)r:   
__module____qualname__r   r   r)   r2   rI   r   r   r   r   r      s    

r   )r7   r@   r   r-   Zos.pathr<   numpyr    r,   Z
numba.coreZnumba.tests.supportr   r   Znumba.misc.help.inspectorr   r   r   r   r   r   r   <module>   s    