
    piV                         d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
mZ  G d de      Zed	k(  r e j                          yy)
    N)patch)TestCase)njit)ir)NotifyLocBase_the_registryc                   B    e Zd Z ej                  ddi      d        Zy)TestMiscCoverageSupportNUMBA_JIT_COVERAGE1)envvarsc                   	  G d dt               }t        |gz   }d}t        ||      5  t        d        } |       }d d d        | j	                  d       d}j
                  j                  |z   }t        j                  t        d      }| j                  d|j                  |      f|j                         | j                  d	|j                         t        ||      5  d
	t        	fd       } |       }d d d        | j	                  |d       |j
                  j                  |z   }| j                  d|j                  |      f|j                         | j                  d|j                  |dz         f|j                         | j                  d|j                  |dz         f|j                         | j                  d	|j                         y # 1 sw Y   xY w# 1 sw Y   xY w)Nc                       e Zd Zg Zd Zd Zy)BTestMiscCoverageSupport.test_custom_loc_notifier.<locals>.MyNotifyc                 >    | j                   j                  d|f       y )NNOTIFYrecordsappend)selflocs     h/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/numba/tests/test_misc_coverage_support.pynotifyzITestMiscCoverageSupport.test_custom_loc_notifier.<locals>.MyNotify.notify   s    ##XsO4    c                 :    | j                   j                  d       y )NCLOSENr   )r   s    r   closezHTestMiscCoverageSupport.test_custom_loc_notifier.<locals>.MyNotify.close   s    ##O4r   N)__name__
__module____qualname__r   r   r    r   r   MyNotifyr      s    G55r   r#   z)numba.misc.coverage_support._the_registryc                       y)N{   r"   r"   r   r   fooz=TestMiscCoverageSupport.test_custom_loc_notifier.<locals>.foo   s    r   r%         r   r   Fc                       ryy)NiA  r%   r"   )conds   r   r&   z=TestMiscCoverageSupport.test_custom_loc_notifier.<locals>.foo1   s    r   )r   r   r   r   assertEqual__code__co_firstlinenor   Loc__file__assertInwith_linenor   assertNotIn)
r   r#   new_the_registrygvr&   resfirst_offsetoffsetr   r*   s
            @r   test_custom_loc_notifierz0TestMiscCoverageSupport.test_custom_loc_notifier   s   	5} 	5 )H:582'( 	  %C	 	c"
 ,,|;ffXq!x!898;K;KLox'7'78 2'( 		D 
 %C		 	c" ,,|;x!898;K;KL 	svz23X5E5E	

 	x!!<=x?O?OPox'7'78[	 	(		 		s   G!G#G #G,N)r   r    r!   r   run_test_in_subprocessr8   r"   r   r   r
   r
      s(    $X$$.BC-HI:9 J:9r   r
   __main__)unittestunittest.mockr   numba.tests.supportr   numbar   
numba.corer   numba.misc.coverage_supportr   r   r
   r   mainr"   r   r   <module>rB      s>      (   D<9h <9~ zHMMO r   