Your IP : 216.73.216.213
���]� � @ sO d d l m Z d d l Z Gd d � d e j � Z e d k rK e j � d S)� )�generator_stopNc @ s( e Z d Z d d � Z d d � Z d S)�
TestPEP479c sI d d � � � f d d � } | j t d � � t | � � Wd QRXd S)Nc S s
t � d S)N)�
StopIteration� r r �0/opt/alt/python35/lib64/python3.5/test_pep479.py�f s z1TestPEP479.test_stopiteration_wrapping.<locals>.fc 3 s � � Vd S)Nr r )r r r �g
s z1TestPEP479.test_stopiteration_wrapping.<locals>.gzgenerator raised StopIteration)ZassertRaisesRegex�RuntimeError�next)�selfr r )r r �test_stopiteration_wrapping s
z&TestPEP479.test_stopiteration_wrappingc s� d d � � � f d d � } y t | � � Wng t k
r� } zG | j t | j � t � | j t | j � t � | j | j � WYd d } ~ Xn X| j d � d S)Nc S s
t � d S)N)r r r r r r s z9TestPEP479.test_stopiteration_wrapping_context.<locals>.fc 3 s � � Vd S)Nr r )r r r r s z9TestPEP479.test_stopiteration_wrapping_context.<locals>.gzE__cause__, __context__, or __suppress_context__ were not properly set)
r
r ZassertIs�type� __cause__r �__context__Z
assertTrue�__suppress_context__Zfail)r r �excr )r r �#test_stopiteration_wrapping_context s #z.TestPEP479.test_stopiteration_wrapping_contextN)�__name__�
__module__�__qualname__r r r r r r r s r �__main__)Z
__future__r ZunittestZTestCaser r �mainr r r r �<module> s