Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_generator_stop.cpython-311.pyc |
�
�Ke� � �n � d dl mZ d dlZ G d� dej � � Zedk r ej � � dS dS )� )�generator_stopNc � � e Zd Zd� Zd� ZdS )�
TestPEP479c � �� d� ��fd�}| � t d� � 5 t |� � � � d d d � � d S # 1 swxY w Y d S )Nc � � t ��N��
StopIteration� � �B/usr/local/apps/python3/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
� �� � � ��!�#�#�I�I�I�I�Ir zgenerator raised StopIteration)�assertRaisesRegex�RuntimeError�next)�selfr r s @r
�test_stopiteration_wrappingz&TestPEP479.test_stopiteration_wrapping s� �� � � � � � � � � �
�
#�
#�L�$D�F� F� � ������I�I�I� � � � � � � � � � � � ���� � � � � � s �A
�
A�Ac � �� d� ��fd�} t |� � � � | � d� � d S # t $ r}| � t |j � � t � � | � t |j � � t � � | � |j � � Y d }~d S d }~ww xY 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� �� � � � � � � � � � /������I�I�I�
�I�I� .�
/�
/�
/�
/�
/�� � 6� 6� 6��M�M�$�s�}�-�-�}�=�=�=��M�M�$�s��/�/��?�?�?��O�O�C�4�5�5�5�5�5�5�5�5�5����� 6���s �9 �
C�A4B=�=CN)�__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����H�M�O�O�O�O�O� �r