
    sh                     v    S SK r S SKrS SKrS SKrS SKrS SKrS SK	Jr  S SK
JrJr  S SKJrJr   " S S\5      rg)    N)types)TestCasetemp_directory)inspect_functioninspect_modulec                   6    \ rS rSrS	S jrS rS rS rS rSr	g)
TestInspector   c                 t   U R                  U[        5        U R                  SU5        US   nUc  U R                  U5        g U R                  U[        R
                  5        U R                  SU5        U R                  US   [        5        U R                  SU5        U R                  US   [        5        g )N
numba_type	explainedsource_infos)assertIsInstancedictassertInassertFalser   Typestr)selfinfomust_be_definedr   s       i/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/numba/tests/test_help.pycheck_function_descriptor'TestInspector.check_function_descriptor   s    dD)lD),'
_-!!*ejj9MM+t,!!${"3S9MM.$/!!$~"6=    c                 B    [        [        5      nU R                  USS9  g )NTr   )r   ranger   )r   r   s     r   test_inspect_function_on_range,TestInspector.test_inspect_function_on_range   s    &&&tT&Br   c                 &   [        [        R                  5      nU R                  USS9  US   nU R	                  [        U5      S5        SnUR                  5        H  nU R                  US   [        5        U R                  US   [        5        U R                  US   [        5        U R                  US   [        5        U R                  US	   [        5        U R                  S
U5        US-  nM     U R                  U[        U5      5        g )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_all-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                 6   Sn[        [        5       Hr  nU R                  US   [        R                  5        U R                  US   [
        5        U R                  [        US   5      5        U R                  U5        US-  nMt     U R                  US5        g )Nr   moduler#   objr(   )
r   builtinsr   pytypes
ModuleTyper   
assertTruecallabler   r+   )r   r0   its      r   test_inspect_module!TestInspector.test_inspect_module0   s     *B!!"X,0B0BC!!"V*c2OOHRY/0**2.FA + 	1a r   c                    [         R                  SS/n[        SR                  [        U R
                  R                  5      5      n[        R                  R                  US5      nUS-   nUSUS/-   nU R                  [        R                  R                  U5      5        [        R                  " U5        U R                  [        R                  R                  U5      5        USUSS	S/-   nUS
-   nU R                  [        R                  R                  U5      5        [        R                  " U5        U R                  [        R                  R                  U5      5        USUSSS/-   nU R                  [        R                  5       n[        R                  " U[        R                   S9  S S S 5        U R#                  SWR$                  R&                  R)                  5       5        g ! , (       d  f       NC= f)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_outputr:   assertRaisesCalledProcessErrorSTDOUTr   	exceptionstdoutdecode)r   cmdbasedirpathr%   expected_filecmdsraisess          r   test_inspect_cli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)
rH   
__module____qualname____firstlineno__r   r   r2   r=   r[   __static_attributes__r]   r   r   r	   r	      s    >C/ !"8r   r	   )rE   rN   r   r8   os.pathrJ   numpyr)   r7   
numba.corenumba.tests.supportr   r   numba.misc.help.inspectorr   r   r	   r]   r   r   <module>rg      s.    
       8 FN8H N8r   