
    <e                     n    d dl mZ d dlZ G d dej                  Zedk    r ej                     dS dS )    )generator_stopNc                       e Zd Zd Zd ZdS )
TestPEP479c                     d fd}|                      t          d          5  t           |                       d d d            d S # 1 swxY w Y   d S )Nc                      t           NStopIteration     //usr/lib/python3.11/test/test_generator_stop.pyfz1TestPEP479.test_stopiteration_wrapping.<locals>.f       r   c               3   $   K                 V  d S r   r   r   s   r   gz1TestPEP479.test_stopiteration_wrapping.<locals>.g
         !##IIIIIr   zgenerator raised StopIteration)assertRaisesRegexRuntimeErrornext)selfr   r   s     @r   test_stopiteration_wrappingz&TestPEP479.test_stopiteration_wrapping   s    	  	  	 	 	 	 	 	##L$DF F 	 	III	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   A

AAc                    d fd}	 t           |                       |                     d           d S # t          $ r}|                     t	          |j                  t                     |                     t	          |j                  t                     |                     |j	                   Y d }~d S 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                 V  d S 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    	  	  	 	 	 	 	 		/III II . / / / / /  	6 	6 	6MM$s}--}===MM$s//???OOC4555555555	6s   9 
CA4B==CN)__name__
__module____qualname__r   r$   r   r   r   r   r      s2          / / / / /r   r   __main__)
__future__r   unittestTestCaser   r%   mainr   r   r   <module>r-      ss    % % % % % % / / / / /" / / /6 zHMOOOOO r   