Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_yield_from.cpython-39.pyc

a

��gx�@sZdZddlZddlZddlmZmZmZddlmZGdd�dej	�Z
edkrVe��dS)z�
Test suite for PEP 380 implementation

adapted from original tests written by Greg Ewing
see <http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-from/YieldFrom-Python3.1.2-rev5.zip>
�N)�captured_stderr�
disable_gc�
gc_collect)�supportc@seZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDS)E�TestPEP380Operationz
    Test semantics.
    csNg���fdd�}�fdd��|�D]}��d|f�q$|��gd��dS)zH
        Test delegation of initial next() call to subgenerator
        c3s$��d���EdH��d�dS�N�Starting g1�Finishing g1��append���g2�tracer�0/usr/local/lib/python3.9/test/test_yield_from.py�g1s
zOTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g1c3s��d�dV��d�dS)N�Starting g2�*�Finishing g2r
r�rrrrs
zOTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g2�
Yielded %s)rrz
Yielded 42rr	N�r�assertEqual��selfr�xrr
r�/test_delegation_of_initial_next_to_subgenerators
zCTestPEP380Operation.test_delegation_of_initial_next_to_subgeneratorc
s�g���fdd�}�fdd��z |�D]}��d|f�q&Wn6tyt}z|�|jdd�WYd}~nd}~00|�d	�|��gd
��dS)z?
        Test raising exception in initial next() call
        c	3s6z$��d���EdHW��d�n��d�0dSrr
rr
rrr1s
zKTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g1c	s2z ��d�td��W��d�n��d�0dS)Nr�spanish inquisition occurredr�r�
ValueErrorrrrrr7s

zKTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g2rrrN�'subgenerator failed to raise ValueError)rrrr	�rrr�args�fail�rrr�err
r�+test_raising_exception_in_initial_next_call,s
(
z?TestPEP380Operation.test_raising_exception_in_initial_next_callcsNg���fdd�}�fdd��|�D]}��d|f�q$|��gd��dS)z@
        Test delegation of next() call to subgenerator
        c3s0��d�dV��EdHdV��d�dS�Nr�g1 ham�g1 eggsr	r
rr
rrrPs

zLTestPEP380Operation.test_delegation_of_next_call_to_subgenerator.<locals>.g1c3s$��d�dVdV��d�dS�Nr�g2 spam�g2 more spamrr
rrrrrVs
zLTestPEP380Operation.test_delegation_of_next_call_to_subgenerator.<locals>.g2r)r�Yielded g1 hamr�Yielded g2 spam�Yielded g2 more spamr�Yielded g1 eggsr	Nrrrr
r�,test_delegation_of_next_call_to_subgeneratorKs
z@TestPEP380Operation.test_delegation_of_next_call_to_subgeneratorc
s�g���fdd�}�fdd��z |�D]}��d|f�q&Wn6tyt}z|�|jdd�WYd}~nd}~00|�d	�|��gd
��dS)zA
        Test raising exception in delegated next() call
        c	3sBz0��d�dV��EdHdVW��d�n��d�0dSr'r
rr
rrrms
zMTestPEP380Operation.test_raising_exception_in_delegated_next_call.<locals>.g1c	3s>z,��d�dVtd��dVW��d�n��d�0dS)Nrr+�hovercraft is full of eelsr,rrrrrrrus
zMTestPEP380Operation.test_raising_exception_in_delegated_next_call.<locals>.g2rrr2Nr �rr-rr.rr	r!r$rr
r�-test_raising_exception_in_delegated_next_callhs
(
zATestPEP380Operation.test_raising_exception_in_delegated_next_callcs�g���fdd�}�fdd��|�}t|�}d}z(|�|�}��d|f�|d7}q2WntyjYn0|��gd��dS)	z+
        Test delegation of send()
        c3sP��d�dV}��d|f���EdHdV}��d|f���d�dS�Nrr(zg1 received %sr)r	r
�rr
rrr�s
z7TestPEP380Operation.test_delegation_of_send.<locals>.g1c3sD��d�dV}��d|f�dV}��d|f���d�dS)Nrr+�g2 received %sr,rr
r6rrrr�s
z7TestPEP380Operation.test_delegation_of_send.<locals>.g2�r)r�
g1 received 1rr.�
g2 received 2r/z
g2 received 3rr0z
g1 received 4r	N)�next�sendr�
StopIterationr)rr�g�yrrr
r�test_delegation_of_send�s
z+TestPEP380Operation.test_delegation_of_sendcsLg���fdd���fdd����fdd�}|�t|�|��gd��dS)	zA
        Test handling exception while delegating 'send'
        c3sP��d�dV}��d|f���EdHdV}��d|f���d�dSr5r
r6r
rrr�s
zMTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.g1c3sL��d�dV}��d|f�td��dV}��d|f���d�dS)Nrr+r7r2r,rrr6rrrr�s
zMTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.g2cs\��}t|�}d}z(|�|�}��d|f�|d7}qWntyV��d�Yn0dS)Nr8rr=)r;r<rr=)r>r?r)rrrr�run�s
zNTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.run)rr9rr.r:N)�assertRaisesrr�rrAr�rrrr�-test_handling_exception_while_delegating_send�szATestPEP380Operation.test_handling_exception_while_delegating_sendcsfg���fdd�}�fdd��|�}td�D]}t|�}��d|f�q,|��|��gd��dS)	z)
        Test delegating 'close'
        c	3sBz0��d�dV��EdHdVW��d�n��d�0dSr'r
rr
rrr�s
z5TestPEP380Operation.test_delegating_close.<locals>.g1c	3s6z$��d�dVdVW��d�n��d�0dSr*r
rrrrr�s

z5TestPEP380Operation.test_delegating_close.<locals>.g2�rr3N)�ranger;r�closer)rrr>�irrr
r�test_delegating_close�sz)TestPEP380Operation.test_delegating_closec
s�g���fdd�}�fdd��z8|�}td�D]}t|�}��d|f�q.|��WnDty�}z,|�|jdd�|�|jt	�WYd	}~nd	}~00|�
d
�|��gd��d	S)zB
        Test handling exception while delegating 'close'
        c	3sBz0��d�dV��EdHdVW��d�n��d�0dSr'r
rr
rrr	s
zMTestPEP380Operation.test_handing_exception_while_delegating_close.<locals>.g1c	3sFz,��d�dVdVW��d�td��n��d�td��0dS)Nrr+r,r�"nybbles have exploded with delightrrrrrrs


�
zMTestPEP380Operation.test_handing_exception_while_delegating_close.<locals>.g2rFrrrKNr r3)rGr;rrHrrr"�assertIsInstance�__context__�
GeneratorExitr#�rrr>rIrr%rr
r�-test_handing_exception_while_delegating_closes$
zATestPEP380Operation.test_handing_exception_while_delegating_closec
s�g���fdd�}�fdd��zB|�}td�D]}t|�}��d|f�q.td�}|�|�Wn6ty�}z|�|jdd�WYd	}~nd	}~00|�d
�|��gd��d	S)z)
        Test delegating 'throw'
        c	3sBz0��d�dV��EdHdVW��d�n��d�0dSr'r
rr
rrr2s
z5TestPEP380Operation.test_delegating_throw.<locals>.g1c	3s6z$��d�dVdVW��d�n��d�0dSr*r
rrrrr:s

z5TestPEP380Operation.test_delegating_throw.<locals>.g2rFr�tomato ejectedrNr r3�rGr;rr�throwrr"r#rOrr
r�test_delegating_throw-s(
z)TestPEP380Operation.test_delegating_throwcsPg��fdd�}t�}||�td�}||�d|_||�|��gd��dS)zC
        Test 'value' attribute of StopIteration exception
        cs,��d|jj|f���d|jf�dS)Nz%s: %sz
value = %s)r�	__class__�__name__�value)r%rrr�pexZszPTestPEP380Operation.test_value_attribute_of_StopIteration_exception.<locals>.pex�spam�eggs)zStopIteration: zvalue = None�StopIteration: spamzvalue = spamr[zvalue = eggsN)r=rWr)rrXr%rrr�/test_value_attribute_of_StopIteration_exceptionUszCTestPEP380Operation.test_value_attribute_of_StopIteration_exceptioncs,�fdd�}dd��|�t|��dg�dS)Nc3s��EdHdS�Nrr�rrrrpsz:TestPEP380Operation.test_exception_value_crash.<locals>.g1cssdVdgS)Nrrrrrrrrrsz:TestPEP380Operation.test_exception_value_crash.<locals>.g2r)r�list)rrrr^r�test_exception_value_crashmsz.TestPEP380Operation.test_exception_value_crashcsPg���fdd�}d�fdd�	�|�D]}��d|f�q&|��gd��dS)	z-
        Test generator return value
        c3sr��d�dV��EdH}��d|f�ddtd�fD]"}�|�EdH}��d|f�q:dV��d�dS)	Nrr(zg2 returned %rr8�rF�r)r	)rr=)�ret�vr
rrr}s
z;TestPEP380Operation.test_generator_return_value.<locals>.g1Nc3s,��d�dVdV��d�|r(|SdSr*r
�rdrrrr�s

z;TestPEP380Operation.test_generator_return_value.<locals>.g2r)rr-rr.r/rzg2 returned Nonerr.r/rz
g2 returned 1rr.r/rzg2 returned (2,)rr.r/rzg2 returned StopIteration(3)r0r	)Nrrrr
r�test_generator_return_valuexs

z/TestPEP380Operation.test_generator_return_valuecCs<g}dd�}|�D]}|�d|f�q|�|gd��dS)z<
        Test delegation of next() to non-generator
        csstd�EdHdS�Nrb�rGrrrrr>�szGTestPEP380Operation.test_delegation_of_next_to_non_generator.<locals>.gr)�	Yielded 0�	Yielded 1�	Yielded 2Nr)rrr>rrrr�(test_delegation_of_next_to_non_generator�s

z<TestPEP380Operation.test_delegation_of_next_to_non_generatorcCsNg}dd�}|�}td�D]}|�d�}|�d|f�q|�|gd��dS)z9
        Test conversion of send(None) to next()
        csstd�EdHdSrgrhrrrrr>�szBTestPEP380Operation.test_conversion_of_sendNone_to_next.<locals>.grbN�Yielded: %s)z
Yielded: 0z
Yielded: 1z
Yielded: 2)rGr<rr)rrr>�girr?rrr�#test_conversion_of_sendNone_to_next�s
z7TestPEP380Operation.test_conversion_of_sendNone_to_nextcspg��fdd�}|�}t|�t��}|��Wd�n1sB0Y|�|��d�|��ddg�dS)z=
        Test delegation of close() to non-generator
        c	3sBz0��d�td�EdH��d�W��d�n��d�0dS�N�
starting grbzg should not be here�finishing g�rrGrrrrr>�s

zHTestPEP380Operation.test_delegation_of_close_to_non_generator.<locals>.gN�rqrr)r;rrHr�getvalue)rr>rn�outputrrr�)test_delegation_of_close_to_non_generator�s&�z=TestPEP380Operation.test_delegation_of_close_to_non_generatorc
s�g��fdd�}zB|�}td�D]}t|�}��d|f�q td�}|�|�Wn6ty�}z|�|jdd�WYd}~nd}~00|�d�|��gd	��dS)
z:
        Test delegating 'throw' to non-generator
        c	3s8z&��d�td�EdHW��d�n��d�0dS)N�
Starting g�
�Finishing grsrrrrr>�s
zETestPEP380Operation.test_delegating_throw_to_non_generator.<locals>.g�rrQrNr )rxrirjrkz	Yielded 3z	Yielded 4rzrR)rr>rnrIrr%rrr�&test_delegating_throw_to_non_generator�s(
z:TestPEP380Operation.test_delegating_throw_to_non_generatorc
s�g��fdd�}z:|�}t|�td�D]}|�d�}��d|f�q(Wn6ty�}z|�d|jd�WYd}~nd}~00|�d	�|��d
dg�dS)z:
        Test attempting to send to non-generator
        c	3sBz0��d�td�EdH��d�W��d�n��d�0dSrprsrrrrr>s

zGTestPEP380Operation.test_attempting_to_send_to_non_generator.<locals>.grbrzShould not have yielded: %sr<rNz#was able to send into non-generatorrqrr)	r;rGr<r�AttributeErrorZassertInr"r#r)rr>rnrr?r%rrr�(test_attempting_to_send_to_non_generators
(
�z<TestPEP380Operation.test_attempting_to_send_to_non_generatorcsGdd�d���fdd�}|�t��0|�}|�t|�d�|�d�Wd�n1sZ0Y|�t��0|�}|�t|�d�|�t�Wd�n1s�0Yt���>}|�}|�t|�d�|�	�|�t|j
j�Wd�n1s�0YdS)zG
        Test subiterator with a broken getattr implementation
        c@s$eZdZdd�Zdd�Zdd�ZdS)z@TestPEP380Operation.test_broken_getattr_handling.<locals>.BrokencSs|Sr]r�rrrr�__iter__"szITestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__iter__cSsdS)Nr8rrrrr�__next__$szITestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__next__cSsdddS�Nr8rr)r�attrrrr�__getattr__&szLTestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__getattr__N)rV�
__module__�__qualname__r�r�r�rrrr�Broken!sr�c3s��EdHdSr]rr�r�rrr>)sz;TestPEP380Operation.test_broken_getattr_handling.<locals>.gr8N)rB�ZeroDivisionErrorrr;r<rSr}rZcatch_unraisable_exceptionrHZ
unraisable�exc_type)rr>rn�cmrr�r�test_broken_getattr_handlings((
z0TestPEP380Operation.test_broken_getattr_handlingcsDg���fdd��dd���fdd�}|�t|�|��dg�dS)	z7
        Test exception in initial next() call
        c3s$��d���EdH��d�dS)N�g1 about to yield from g2�g1 should not be herer
rr
rrrBs
zCTestPEP380Operation.test_exception_in_initial_next_call.<locals>.g1cssddVdSr�rrrrrrFszCTestPEP380Operation.test_exception_in_initial_next_call.<locals>.g2cs��}t|�dSr])r;)rn�rrrrAHszDTestPEP380Operation.test_exception_in_initial_next_call.<locals>.runr�N)rBr�rrCrrDr�#test_exception_in_initial_next_call=s�z7TestPEP380Operation.test_exception_in_initial_next_callc
s�g���fdd�}��fdd��z$|���D]}��d|f�q,Wn6tyz}z|�|jdd�WYd}~nd}~00|�d	�|��gd
��dS)z0
        Test attempted yield-from loop
        c3s4��d�dV��d���EdH��d�dS)N�g1: startingZy1�g1: about to yield from g2r�r
rr
rrrUs


z>TestPEP380Operation.test_attempted_yield_from_loop.<locals>.g1c3s2��d�dV��d��EdH��d�dS)N�g2: startingZy2�g2: about to yield from g1zg2 should not be herer
r)rnrrrr\s



z>TestPEP380Operation.test_attempted_yield_from_loop.<locals>.g2rmrzgenerator already executingNz$subgenerator didn't raise ValueError)r�zYielded: y1r�r�zYielded: y2r�r!)rrr?r%r)rrnrr�test_attempted_yield_from_loopPs(
z2TestPEP380Operation.test_attempted_yield_from_loopcs�g���fdd�}��fdd��Gdd�dt��|�}td�D]}t|�}��d|f�q>�d	�}|�|�|D]}��d|f�qr|��gd
��dS)z=
        Test returning value from delegated 'throw'
        c	3sBz0��d�dV��EdHdVW��d�n��d�0dSr'r
rr
rrrxs
zITestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.g1c3sHz��d�dVdVWn(�yB��d�dVdVYn0dS)Nrr+r,�Caught LunchError in g2zg2 lunch savedzg2 yet more spamr
r)�
LunchErrorrrrr�s


zITestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.g2c@seZdZdS)zQTestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.LunchErrorN�rVr�r�rrrrr��sr�rFrrQ)rr-rr.r�zYielded g2 yet more spamr0r	N)�	ExceptionrGr;rrSrrOr)r�rrr�)test_returning_value_from_delegated_throwss	
z=TestPEP380Operation.test_returning_value_from_delegated_throwcsVg���fdd�}�fdd��|d�|d�|d�|td��|��gd	��dS)
z1
        Test next and return with value
        c
sj�|�}t|�z ��d�t|���d�Wn4tyd}z��d|f�WYd}~n
d}~00dS)N�f resuming g�f SHOULD NOT BE HERE�f caught %r)r;rr=��rrnr%�r>rrr�f�s
z>TestPEP380Operation.test_next_and_return_with_value.<locals>.fc3s$��d�dV��d|f�|S)N�
g starting�g returning %rr
)r�rrrr>�s
z>TestPEP380Operation.test_next_and_return_with_value.<locals>.gNr8rarb)r�r��g returning None�f caught StopIteration()r�r��
g returning 1�f caught StopIteration(1)r�r��g returning (2,)�f caught StopIteration((2,))r�r��g returning StopIteration(3)�(f caught StopIteration(StopIteration(3))�r=r�rr�rr�r�test_next_and_return_with_value�s	z3TestPEP380Operation.test_next_and_return_with_valuecsVg���fdd�}�fdd��|d�|d�|d�|td��|��gd	��dS)
z1
        Test send and return with value
        c
sl�|�}t|�z"��d�|�d���d�Wn4tyf}z��d|f�WYd}~n
d}~00dS)N�f sending spam to grYr�r�)r;rr<r=r�r�rrr��s

z>TestPEP380Operation.test_send_and_return_with_value.<locals>.fc3s4��d�dV}��d|f���d|f�|S)Nr�z
g received %rr�r
)r�rrrrr>�s

z>TestPEP380Operation.test_send_and_return_with_value.<locals>.gNr8rarb)r�r��g received 'spam'r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�test_send_and_return_with_value�s	z3TestPEP380Operation.test_send_and_return_with_valuec	s~��fdd����fdd�}ddtd�fD]N�g�|�}��t|����t|�t���|��ddd	�ft��g�q*d
S)ze
        Test catching an exception thrown into a
        subgenerator and returning a value
        c3s,z
dVWnty&��d�Yn0�S)Nr8�inner caught ValueError)rrr)rrWrr�inner�s

zTTestPEP380Operation.test_catching_exception_from_subgen_and_returning.<locals>.innerc3s&��EdH}��d|f�|VdS)N�inner returned %r to outerr
re)r�rrr�outerszTTestPEP380Operation.test_catching_exception_from_subgen_and_returning.<locals>.outerrFrar8r�r�N)r=rr;�reprrSrr�rr�r>r)r�rrWr�1test_catching_exception_from_subgen_and_returning�s�zETestPEP380Operation.test_catching_exception_from_subgen_and_returningcslg��fdd����fdd�}z|�}t|�|�t�WntyLYn0|�d�|��ddg�dS)	zo
        Test throwing GeneratorExit into a subgenerator that
        catches it and returns normally.
        c3s8z��d�dV��d�Wnty2YdS0dS�N�Enter f�Exit f�rrNrrrrr�s
zSTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns.<locals>.fc3s$��d���EdH��d�dS�N�Enter gzExit gr
r�r�rrrr>!s
zSTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns.<locals>.g�*subgenerator failed to raise GeneratorExitr�r�N)r;rSrNr#r)rr>rnrr�r�4test_throwing_GeneratorExit_into_subgen_that_returnss
�zHTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returnsc
s�g��fdd����fdd�}z|�}t|�|�t�Wn6typ}z|�|jdd�WYd}~nd}~00|�d�|��d	d
g�dS)ze
        Test throwing GeneratorExit into a subgenerator that
        catches it and yields.
        c3s<z��d�dV��d�Wnty6dVYn0dSr�r�rrrrr�8s
zXTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields.<locals>.fc3s$��d���EdH��d�dSr�r
rr�rrr>?s
zXTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields.<locals>.grzgenerator ignored GeneratorExitNr�r�r�)r;rSrN�RuntimeErrorrr"r#�rr>rnr%rr�r�9test_throwing_GeneratorExit_into_subgenerator_that_yields2s(
�zMTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yieldsc
s�g��fdd����fdd�}z|�}t|�|�t�WnDty~}z,|�|jdd�|�|jt�WYd}~nd}~00|�d�|��d	d
g�dS)z{
        Test throwing GeneratorExit into a subgenerator that
        catches it and raises a different exception.
        c3s>z��d�dV��d�Wnty8td��Yn0dS)Nr�r��Vorpal bunny encountered)rrNrrrrrr�Vs
zRTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raises.<locals>.fc3s$��d���EdH��d�dSr�r
rr�rrr>]s
zRTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raises.<locals>.grr�Nr r�r�)	r;rSrNrrr"rLrMr#r�rr�r�3test_throwing_GeneratorExit_into_subgen_that_raisesPs$
�zGTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raisescCsdd�}|�tt|��dS)NcssdEdHdS)Nrrrrrrr>psz4TestPEP380Operation.test_yield_from_empty.<locals>.g)rBr=r;)rr>rrr�test_yield_from_emptyosz)TestPEP380Operation.test_yield_from_emptycs�fdd�}�fdd��|����t��gd��|��t��g}z|���d��qDWntyjYn0��|gd��Gdd�dt����fd	d�}��fd
d��|��t��g}z|������q�Wnty�Yn0G��fdd�dt���fd
d�}|��t����	�dS)Nc3sdV��EdHdVdS�Nrrbrr)�tworr�onevszOTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.onec3s2dVz�EdHWnty&Yn0dVdS�Nr8rF�rrr�rrr�zszOTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.two)rr8rFrbrc@seZdZdS)zQTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyErrNr�rrrr�MyErr�sr�c3sLz
dVWn�yYn0��EdHz
dVWn�yFYn0dSr�rr)r�r�rrr��s

c3sbz
dVWn�yYn0z�EdHWnty>Yn0z
dVWn�y\Yn0dSr�r�r)r�rrrr��s

cs*eZdZdd�Zdd�Z��fdd�ZdS)zPTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyItcSs|Sr]rrrrrr��szYTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.__iter__cSsdS�Nrrrrrrr��szYTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.__next__cs���j���tt��dSr])�
assertTrue�
gi_runningrBrr;)Zself_�rrrrrH�szVTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.closeN)rVr�r�r�r�rHrr�rr�MyIt�sr�c3s��EdHdSr]rr)r�rrr��s)
rr_r;rr<r=r�rS�objectrH)rr��resr)r�r�rrr�r�.test_delegating_generators_claim_to_be_runningts2



zBTestPEP380Operation.test_delegating_generators_claim_to_be_runningcspdd���fdd�}dd�}dd�}||��D]}|�d	|v�q.|||���D]}|�d	|vofd
|v�qPdS)NcSsdd�t��D�S)NcSsg|]}|d�qS)rbr)�.0r�rrr�
<listcomp>��zaTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.call_stack.<locals>.<listcomp>)�inspect�stackrrrr�
call_stack�szMTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.call_stackc3s��V��V��VdSr]rr�r�rr�gen�szFTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.gencss|EdHdSr]r�r>rrrrY�szGTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.spamcss|EdHdSr]rr�rrrrZ�szGTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.eggsrYrZ)r�)rr�rYrZr�rr�r�%test_delegator_is_visible_to_debugger�sz9TestPEP380Operation.test_delegator_is_visible_to_debuggercs:Gdd�d����fdd�}d�t|��|��d�dS)Nc@seZdZdd�Zdd�ZdS)z?TestPEP380Operation.test_custom_iterator_return.<locals>.MyItercSs|Sr]rrrrrr��szHTestPEP380Operation.test_custom_iterator_return.<locals>.MyIter.__iter__cSstd��dSr�)r=rrrrr��szHTestPEP380Operation.test_custom_iterator_return.<locals>.MyIter.__next__N)rVr�r�r�r�rrrr�MyIter�sr�c3s��EdH�dSr]rr�r�rcrrr��sz<TestPEP380Operation.test_custom_iterator_return.<locals>.genr)r_r)rr�rr�r�test_custom_iterator_return�s

z/TestPEP380Operation.test_custom_iterator_returncszdd���fdd�}dd�}t��D|�}|�}|�d�|�|�|�|�~~t�Wd�n1sl0YdS)Ncss
dVdSr]rrrrr�	innermost�szDTestPEP380Operation.test_close_with_cleared_frame.<locals>.innermostc3sdV}��EdHdSr]r)�	outer_gen�r�rrr��sz@TestPEP380Operation.test_close_with_cleared_frame.<locals>.innercssdV}|EdHdSr]r)�	inner_genrrrr��sz@TestPEP380Operation.test_close_with_cleared_frame.<locals>.outer)rr<r)rr�r�r�r�rr�r�test_close_with_cleared_frame�s


z1TestPEP380Operation.test_close_with_cleared_framecsJG�fdd�d���fdd�}|�}t|�d�|�d�|��d�dS)Ncs(eZdZdd�Zdd�Z�fdd�ZdS)zHTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGencSs|Sr]rrrrrr�	szQTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.__iter__cSsdSr�rrrrrr�szQTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.__next__cs|�dSr]r)rZwhatrerrr<
szMTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.sendN)rVr�r�r�r�r<rrerr�MyGensr�c3s��EdH}dSr]rre)r�rrr�szHTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.outer)r8rFrb�)r;r<rr�r)r�rdr�%test_send_tuple_with_custom_generators	
z9TestPEP380Operation.test_send_tuple_with_custom_generatorN)%rVr�r��__doc__rr&r1r4r@rErJrPrTr\r`rfrlrorwr|r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrsD%,)")(3  #+*/H'r�__main__)
r�Zunittestr�Ztest.supportrrr�testrZTestCaserrV�mainrrrr�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists