
    daf                     p    d dl mZ d dlZ G d dej                        Zedk(  r ej                          yy)    )generator_stopNc                       e Zd Zd Zd Zy)
TestPEP479c                     d fd}| j                  t        d      5  t         |              d d d        y # 1 sw Y   y xY w)Nc                      t         NStopIteration     3/root/Python-3.12.4/Lib/test/test_generator_stop.pyfz1TestPEP479.test_stopiteration_wrapping.<locals>.f       r   c               3       K             y wr   r   r   s   r   gz1TestPEP479.test_stopiteration_wrapping.<locals>.g
        #I   zgenerator raised StopIteration)assertRaisesRegexRuntimeErrornext)selfr   r   s     @r   test_stopiteration_wrappingz&TestPEP479.test_stopiteration_wrapping   s?    	 	##L$DF 	I	 	 	s	   :Ac                 `   d fd}	 t         |              | j                  d       y # t        $ rw}| j                  t	        |j
                        t               | j                  t	        |j                        t               | j                  |j                         Y d }~y d }~ww xY w)Nc                      t         r   r	   r   r   r   r   z9TestPEP479.test_stopiteration_wrapping_context.<locals>.f   r   r   c               3       K             y wr   r   r   s   r   r   z9TestPEP479.test_stopiteration_wrapping_context.<locals>.g   r   r   zE__cause__, __context__, or __suppress_context__ were not properly set)
r   failr   assertIstype	__cause__r
   __context__
assertTrue__suppress_context__)r   r   excr   s      @r   #test_stopiteration_wrapping_contextz.TestPEP479.test_stopiteration_wrapping_context   s    	 		/I II . /  	6MM$s}}-}=MM$s/?OOC4455	6s   - 	B-A-B((B-N)__name__
__module____qualname__r   r%   r   r   r   r   r      s    /r   r   __main__)
__future__r   unittestTestCaser   r&   mainr   r   r   <module>r.      s7    % /"" /6 zHMMO r   