Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/test_yield_from.cpython-38.pyc
U

>��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.
    csTg���fdd�}�fdd��|�D]}��d|f�q$|��dddd	d
g�dS)zH
        Test delegation of initial next() call to subgenerator
        c3s$��d���EdH��d�dS)N�Starting g1�Finishing g1��append���g2�tracer�3/opt/cppython/lib/python3.8/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�rrrr
s
zOTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g2�
Yielded %srrz
Yielded 42rrN�r
�assertEqual��selfr�xrr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&Wn4tk
rr}z|�|jdd�W5d}~XYnX|�d	�|��d
ddd
g�dS)z?
        Test raising exception in initial next() call
        c	3s,z��d���EdHW5��d�XdS)Nrrr	rrrrr1s
zKTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g1c	s(z��d�td��W5��d�XdS)Nrr�spanish inquisition occurred�r
�
ValueErrorrrrrr
7s
zKTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g2rrrN�'subgenerator failed to raise ValueErrorrrrr�r
rr�args�fail�rrr�errr�+test_raising_exception_in_initial_next_call,s
$
�z?TestPEP380Operation.test_raising_exception_in_initial_next_callcsZg���fdd�}�fdd��|�D]}��d|f�q$|��dddd	d
ddd
g�dS)z@
        Test delegation of next() call to subgenerator
        c3s0��d�dV��EdHdV��d�dS)Nr�g1 ham�g1 eggsrr	rrrrrPs

zLTestPEP380Operation.test_delegation_of_next_call_to_subgenerator.<locals>.g1c3s$��d�dVdV��d�dS�Nr�g2 spam�g2 more spamrr	rrrrr
Vs
zLTestPEP380Operation.test_delegation_of_next_call_to_subgenerator.<locals>.g2rr�Yielded g1 hamr�Yielded g2 spam�Yielded g2 more spamr�Yielded g1 eggsrNrrrr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&Wn4tk
rr}z|�|jdd�W5d}~XYnX|�d	�|��d
ddd
ddg�dS)zA
        Test raising exception in delegated next() call
        c	3s8z&��d�dV��EdHdVW5��d�XdS�Nrrr&r'r	rrrrrms

zMTestPEP380Operation.test_raising_exception_in_delegated_next_call.<locals>.g1c	3s4z"��d�dVtd��dVW5��d�XdS)Nrrr)�hovercraft is full of eelsr*rrrrrr
us

zMTestPEP380Operation.test_raising_exception_in_delegated_next_call.<locals>.g2rrr1Nrrr+rr,rrr r#rr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}q2Wntk
rlYnX|��ddd	d
ddd
ddddg�dS)z+
        Test delegation of send()
        c3sP��d�dV}��d|f���EdHdV}��d|f���d�dS�Nrr&zg1 received %sr'rr	�rrrrr�s
z7TestPEP380Operation.test_delegation_of_send.<locals>.g1c3sD��d�dV}��d|f�dV}��d|f���d�dS)Nrr)�g2 received %sr*rr	r4rrrr
�s
z7TestPEP380Operation.test_delegation_of_send.<locals>.g2�rr�
g1 received 1rr,�
g2 received 2r-z
g2 received 3rr.z
g1 received 4rN)�next�sendr
�
StopIterationr)rr�g�yrrrr�test_delegation_of_send�s2
�z+TestPEP380Operation.test_delegation_of_sendcsRg���fdd���fdd����fdd�}|�t|�|��ddd	d
dg�dS)
zA
        Test handling exception while delegating 'send'
        c3sP��d�dV}��d|f���EdHdV}��d|f���d�dSr3r	r4rrrr�s
zMTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.g1c3sL��d�dV}��d|f�td��dV}��d|f���d�dS)Nrr)r5r1r*rrr4rrrr
�s
zMTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.g2cs^��}t|�}d}z(|�|�}��d|f�|d7}qWntk
rX��d�YnXdS)Nr6rr;)r9r:r
r;)r<r=r)rrrr�run�s
zNTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.runrr7rr,r8N)�assertRaisesrr�rr?r�rr
rr�-test_handling_exception_while_delegating_send�s�zATestPEP380Operation.test_handling_exception_while_delegating_sendc	sng���fdd�}�fdd��|�}td�D]}t|�}��d|f�q,|��|��ddd	d
ddg�d
S)z)
        Test delegating 'close'
        c	3s8z&��d�dV��EdHdVW5��d�XdSr0r	rrrrr�s

z5TestPEP380Operation.test_delegating_close.<locals>.g1c	3s,z��d�dVdVW5��d�XdS�Nrrr)r*r	rrrrr
�s


z5TestPEP380Operation.test_delegating_close.<locals>.g2�rrr+rr,rrN)�ranger9r
�closer)rrr<�irrrr�test_delegating_close�s �z)TestPEP380Operation.test_delegating_closec
s�g���fdd�}�fdd��z8|�}td�D]}t|�}��d|f�q.|��WnBtk
r�}z$|�|jdd�|�|jt	�W5d	}~XYnX|�
d
�|��ddd
dddg�d	S)zB
        Test handling exception while delegating 'close'
        c	3s8z&��d�dV��EdHdVW5��d�XdSr0r	rrrrr	s

zMTestPEP380Operation.test_handing_exception_while_delegating_close.<locals>.g1c	3s4z��d�dVdVW5��d�td��XdS)Nr�"nybbles have exploded with delightrr)r*rrrrrr
s


zMTestPEP380Operation.test_handing_exception_while_delegating_close.<locals>.g2rErrrJNrrr+rr,rr)rFr9r
rGrrr!�assertIsInstance�__context__�
GeneratorExitr"�rrr<rHrr$rr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�}|�|�Wn4tk
r�}z|�|jdd�W5d	}~XYnX|�d
�|��ddd
dddg�d	S)z)
        Test delegating 'throw'
        c	3s8z&��d�dV��EdHdVW5��d�XdSr0r	rrrrr2s

z5TestPEP380Operation.test_delegating_throw.<locals>.g1c	3s,z��d�dVdVW5��d�XdSrDr	rrrrr
:s


z5TestPEP380Operation.test_delegating_throw.<locals>.g2rEr�tomato ejectedrNrrr+rr,rr�rFr9r
r�throwrr!r"rNrrr�test_delegating_throw-s*$
�z)TestPEP380Operation.test_delegating_throwc	sXg��fdd�}t�}||�td�}||�d|_||�|��dddddd	g�d
S)zC
        Test 'value' attribute of StopIteration exception
        cs,��d|jj|f���d|jf�dS)Nz%s: %sz
value = %s)r
�	__class__�__name__�value)r$rrr�pexZszPTestPEP380Operation.test_value_attribute_of_StopIteration_exception.<locals>.pex�spam�eggszStopIteration: zvalue = NonezStopIteration: spamzvalue = spamzvalue = eggsN)r;rVr)rrWr$rrr�/test_value_attribute_of_StopIteration_exceptionUs �zCTestPEP380Operation.test_value_attribute_of_StopIteration_exceptioncs,�fdd�}dd��|�t|��dg�dS)Nc3s��EdHdS�Nrr�r
rrrpsz:TestPEP380Operation.test_exception_value_crash.<locals>.g1cssdVdgS)Nr
rrrrrrr
rsz:TestPEP380Operation.test_exception_value_crash.<locals>.g2r
)r�list)rrrr\r�test_exception_value_crashmsz.TestPEP380Operation.test_exception_value_crashcs|g���fdd�}d�fdd�	�|�D]}��d|f�q&|��ddd	d
ddd
d	d
dddd	d
dddd	d
dddddg�dS)z-
        Test generator return value
        c3sr��d�dV��EdH}��d|f�ddtd�fD]"}�|�EdH}��d|f�q:dV��d�dS)	Nrr&zg2 returned %rr6�rE�r'r)r
r;)�ret�vrrrr}s
z;TestPEP380Operation.test_generator_return_value.<locals>.g1Nc3s,��d�dVdV��d�|r(|SdSr(r	�rbrrrr
�s

z;TestPEP380Operation.test_generator_return_value.<locals>.g2rrr+rr,r-rzg2 returned Nonez
g2 returned 1zg2 returned (2,)zg2 returned StopIteration(3)r.r)Nrrrrr�test_generator_return_valuexs>

�z/TestPEP380Operation.test_generator_return_valuecCs>g}dd�}|�D]}|�d|f�q|�|dddg�dS)z<
        Test delegation of next() to non-generator
        csstd�EdHdS�Nr`�rFrrrrr<�szGTestPEP380Operation.test_delegation_of_next_to_non_generator.<locals>.gr�	Yielded 0�	Yielded 1�	Yielded 2Nr)rrr<rrrr�(test_delegation_of_next_to_non_generator�s
�z<TestPEP380Operation.test_delegation_of_next_to_non_generatorcCsPg}dd�}|�}td�D]}|�d�}|�d|f�q|�|dddg�dS)	z9
        Test conversion of send(None) to next()
        csstd�EdHdSrerfrrrrr<�szBTestPEP380Operation.test_conversion_of_sendNone_to_next.<locals>.gr`N�Yielded: %sz
Yielded: 0z
Yielded: 1z
Yielded: 2)rFr:r
r)rrr<�girr=rrr�#test_conversion_of_sendNone_to_next�s
�z7TestPEP380Operation.test_conversion_of_sendNone_to_nextc	s\g��fdd�}|�}t|�t��}|��W5QRX|�|��d�|��ddg�dS)z=
        Test delegation of close() to non-generator
        c	3s8z&��d�td�EdH��d�W5��d�XdS�N�finishing g�
starting gr`zg should not be here�r
rFrrrrr<�s

zHTestPEP380Operation.test_delegation_of_close_to_non_generator.<locals>.g�rproN)r9rrGr�getvalue)rr<rl�outputrrr�)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�}|�|�Wn4tk
r�}z|�|jdd�W5d}~XYnX|�d�|��d	d
ddd
ddg�dS)z:
        Test delegating 'throw' to non-generator
        c	3s.z��d�td�EdHW5��d�XdS)N�Finishing g�
Starting g�
rqrrrrr<�s
zETestPEP380Operation.test_delegating_throw_to_non_generator.<locals>.g�rrPrNrrwrgrhriz	Yielded 3z	Yielded 4rvrQ)rr<rlrHrr$rrr�&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(Wn4tk
r~}z|�d|jd�W5d}~XYnX|�d	�|��d
dg�dS)z:
        Test attempting to send to non-generator
        c	3s8z&��d�td�EdH��d�W5��d�XdSrnrqrrrrr<s

zGTestPEP380Operation.test_attempting_to_send_to_non_generator.<locals>.gr`rzShould not have yielded: %sr:rNz#was able to send into non-generatorrpro)	r9rFr:r
�AttributeErrorZassertInr!r"r)rr<rlrr=r$rrr�(test_attempting_to_send_to_non_generators
$
�z<TestPEP380Operation.test_attempting_to_send_to_non_generatorc	s�Gdd�d���fdd�}|�t��&|�}|�t|�d�|�d�W5QRX|�t��&|�}|�t|�d�|�t�W5QRXt���4}|�}|�t|�d�|�	�|�t|j
j�W5QRXdS)zG
        Test subiterator with a broken getattr implementation
        c@s$eZdZdd�Zdd�Zdd�ZdS)z@TestPEP380Operation.test_broken_getattr_handling.<locals>.BrokencSs|Sr[r�rrrr�__iter__"szITestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__iter__cSsdS)Nr6rr}rrr�__next__$szITestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__next__cSsdddS�Nr6rr)r�attrrrr�__getattr__&szLTestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__getattr__N)rU�
__module__�__qualname__r~rr�rrrr�Broken!sr�c3s��EdHdSr[rr�r�rrr<)sz;TestPEP380Operation.test_broken_getattr_handling.<locals>.gr6N)r@�ZeroDivisionErrorrr9r:rRr{rZcatch_unraisable_exceptionrGZ
unraisable�exc_type)rr<rl�cmrr�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	rrrrrBs
zCTestPEP380Operation.test_exception_in_initial_next_call.<locals>.g1cssddVdSr�rrrrrr
FszCTestPEP380Operation.test_exception_in_initial_next_call.<locals>.g2cs��}t|�dSr[)r9)rl�rrrr?HszDTestPEP380Operation.test_exception_in_initial_next_call.<locals>.runr�N)r@r�rrArrBr�#test_exception_in_initial_next_call=s�z7TestPEP380Operation.test_exception_in_initial_next_callc
s�g���fdd�}��fdd��z$|���D]}��d|f�q,Wn4tk
rx}z|�|jdd�W5d}~XYnX|�d	�|��d
ddd
ddg�dS)z0
        Test attempted yield-from loop
        c3s4��d�dV��d���EdH��d�dS)N�g1: startingZy1�g1: about to yield from g2r�r	rrrrrUs


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)rlrrrr
\s



z>TestPEP380Operation.test_attempted_yield_from_loop.<locals>.g2rkrzgenerator already executingNz$subgenerator didn't raise ValueErrorr�zYielded: y1r�r�zYielded: y2r�r )rrr=r$r)r
rlrr�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|��d
ddd
ddddg�dS)z=
        Test returning value from delegated 'throw'
        c	3s8z&��d�dV��EdHdVW5��d�XdSr0r	rrrrrxs

zITestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.g1c3sJz��d�dVdVWn*�k
rD��d�dVdVYnXdS)Nrr)r*�Caught LunchError in g2zg2 lunch savedzg2 yet more spamr	r)�
LunchErrorrrrr
�s


zITestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.g2c@seZdZdS)zQTestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.LunchErrorN�rUr�r�rrrrr��sr�rErrPrr+rr,r�zYielded g2 yet more spamr.rN)�	ExceptionrFr9r
rRrrNr)r�r
rr�)test_returning_value_from_delegated_throwss,	
�z=TestPEP380Operation.test_returning_value_from_delegated_throwcsrg���fdd�}�fdd��|d�|d�|d�|td��|��d	d
ddd	d
d
dd	d
ddd	d
ddg�dS)z1
        Test next and return with value
        c
sh�|�}t|�z ��d�t|���d�Wn2tk
rb}z��d|f�W5d}~XYnXdS)N�f resuming g�f SHOULD NOT BE HERE�f caught %r)r9r
r;��rrlr$�r<rrr�f�s
z>TestPEP380Operation.test_next_and_return_with_value.<locals>.fc3s$��d�dV��d|f�|S)N�
g starting�g returning %rr	)r�rrrr<�s
z>TestPEP380Operation.test_next_and_return_with_value.<locals>.gNr6r_r`r�r��g returning None�f caught StopIteration()�
g returning 1�f caught StopIteration(1)�g returning (2,)�f caught StopIteration((2,))�g returning StopIteration(3)�(f caught StopIteration(StopIteration(3))�r;r�rr�rr�r�test_next_and_return_with_value�s2	�z3TestPEP380Operation.test_next_and_return_with_valuecszg���fdd�}�fdd��|d�|d�|d�|td��|��d	d
ddd
d	d
dddd	d
dddd	d
dddg�dS)z1
        Test send and return with value
        c
sj�|�}t|�z"��d�|�d���d�Wn2tk
rd}z��d|f�W5d}~XYnXdS)N�f sending spam to grXr�r�)r9r
r:r;r�r�rrr��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�rrrrr<�s

z>TestPEP380Operation.test_send_and_return_with_value.<locals>.gNr6r_r`r�r�zg received 'spam'r�r�r�r�r�r�r�r�r�r�rr�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
dVWntk
r(��d�YnX�S)Nr6�inner caught ValueError)rr
r)rrVrr�inner�s

zTTestPEP380Operation.test_catching_exception_from_subgen_and_returning.<locals>.innerc3s&��EdH}��d|f�|VdS)N�inner returned %r to outerr	rc)r�rrr�outerszTTestPEP380Operation.test_catching_exception_from_subgen_and_returning.<locals>.outerrEr_r6r�r�N)r;r
r9�reprrRrr�rr�r<r)r�rrVr�1test_catching_exception_from_subgen_and_returning�s�zETestPEP380Operation.test_catching_exception_from_subgen_and_returningcsng��fdd����fdd�}z|�}t|�|�t�Wntk
rNYnX|�d�|��ddg�dS)	zo
        Test throwing GeneratorExit into a subgenerator that
        catches it and returns normally.
        c3s:z��d�dV��d�Wntk
r4YdSXdS�N�Enter f�Exit f�r
rMrrrrr�s
zSTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns.<locals>.fc3s$��d���EdH��d�dS�N�Enter gzExit gr	r�r�rrrr<!s
zSTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns.<locals>.g�*subgenerator failed to raise GeneratorExitr�r�N)r9rRrMr"r)rr<rlrr�r�4test_throwing_GeneratorExit_into_subgen_that_returnss
�zHTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returnsc
s�g��fdd����fdd�}z|�}t|�|�t�Wn4tk
rn}z|�|jdd�W5d}~XYnX|�d�|��d	d
g�dS)ze
        Test throwing GeneratorExit into a subgenerator that
        catches it and yields.
        c3s>z��d�dV��d�Wntk
r8dVYnXdSr�r�rrrrr�8s
zXTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields.<locals>.fc3s$��d���EdH��d�dSr�r	rr�rrr<?s
zXTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields.<locals>.grzgenerator ignored GeneratorExitNr�r�r�)r9rRrM�RuntimeErrorrr!r"�rr<rlr$rr�r�9test_throwing_GeneratorExit_into_subgenerator_that_yields2s$
�zMTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yieldsc
s�g��fdd����fdd�}z|�}t|�|�t�WnBtk
r|}z$|�|jdd�|�|jt�W5d}~XYnX|�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�Wntk
r:td��YnXdS)Nr�r��Vorpal bunny encountered)r
rMrrrrrr�Vs
zRTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raises.<locals>.fc3s$��d���EdH��d�dSr�r	rr�rrr<]s
zRTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raises.<locals>.grr�Nrr�r�)	r9rRrMrrr!rKrLr"r�rr�r�3test_throwing_GeneratorExit_into_subgen_that_raisesPs 
�zGTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raisescCsdd�}|�tt|��dS)NcssdEdHdS)Nrrrrrrr<psz4TestPEP380Operation.test_yield_from_empty.<locals>.g)r@r;r9)rr<rrr�test_yield_from_emptyosz)TestPEP380Operation.test_yield_from_emptycs*�fdd�}�fdd��|����t��ddddg�|��t��g}z|���d	��qHWntk
rpYnX��|ddddg�Gd
d�dt����fdd�}��fd
d��|��t��g}z|������q�Wntk
r�YnXG��fdd�dt���fdd�}|��t����	�dS)Nc3sdV��EdHdVdS�Nrr`rr)�tworr�onevszOTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.onec3s4dVz�EdHWntk
r(YnXdVdS�Nr6rE�rrr�rrr�zszOTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.tworr6rEr`rc@seZdZdS)zQTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyErrNr�rrrr�MyErr�sr�c3sPz
dVWn�k
rYnX��EdHz
dVWn�k
rJYnXdSr�rr)r�r�rrr��s

c3shz
dVWn�k
rYnXz�EdHWntk
rBYnXz
dVWn�k
rbYnXdSr�r�r)r�rrrr��s

cs*eZdZdd�Zdd�Z��fdd�ZdS)zPTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyItcSs|Sr[rr}rrrr~�szYTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.__iter__cSsdS�Nrrr}rrrr�szYTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.__next__cs���j���tt��dSr[)�
assertTrue�
gi_runningr@rr9)Zself_�rrrrrG�szVTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.closeN)rUr�r�r~rrGrr�rr�MyIt�sr�c3s��EdHdSr[rr)r�rrr��s)
rr]r9r
r:r;r�rR�objectrG)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	|k�q.|||���D]}|�d	|kofd
|k�qPdS)NcSsdd�t��D�S)NcSsg|]}|d�qS)r`r)�.0r�rrr�
<listcomp>�szaTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.call_stack.<locals>.<listcomp>)�inspect�stackrrrr�
call_stack�szMTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.call_stackc3s��V��V��VdSr[rr�r�rr�gen�szFTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.gencss|EdHdSr[r�r<rrrrX�szGTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.spamcss|EdHdSr[rr�rrrrY�szGTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.eggsrXrY)r�)rr�rXrYr�rr�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[rr}rrrr~�szHTestPEP380Operation.test_custom_iterator_return.<locals>.MyIter.__iter__cSstd��dSr�)r;r}rrrr�szHTestPEP380Operation.test_custom_iterator_return.<locals>.MyIter.__next__N)rUr�r�r~rrrrr�MyIter�sr�c3s��EdH�dSr[rr�r�rarrr��sz<TestPEP380Operation.test_custom_iterator_return.<locals>.genr)r]r)rr�rr�r�test_custom_iterator_return�s

z/TestPEP380Operation.test_custom_iterator_returnc	sfdd���fdd�}dd�}t��:|�}|�}|�d�|�|�|�|�~~t�W5QRXdS)Ncss
dVdSr[rrrrr�	innermost�szDTestPEP380Operation.test_close_with_cleared_frame.<locals>.innermostc3sdV}��EdHdSr[r)�	outer_gen�r�rrr��sz@TestPEP380Operation.test_close_with_cleared_frame.<locals>.innercssdV}|EdHdSr[r)�	inner_genrrrr��sz@TestPEP380Operation.test_close_with_cleared_frame.<locals>.outer)rr:r)rr�r�r�r�rr�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[rr}rrrr~	szQTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.__iter__cSsdSr�rr}rrrrszQTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.__next__cs|�dSr[r)rZwhatrcrrr:
szMTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.sendN)rUr�r�r~rr:rrcrr�MyGensr�c3s��EdH}dSr[rrc)r�rrr�szHTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.outer)r6rEr`�)r9r:rr�r)r�rbr�%test_send_tuple_with_custom_generators	
z9TestPEP380Operation.test_send_tuple_with_custom_generatorN)%rUr�r��__doc__rr%r/r2r>rCrIrOrSrZr^rdrjrmrurzr|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrsD%,)")(3  #+*/H'r�__main__)
r�Zunittestr�Ztest.supportrrr�testrZTestCaserrU�mainrrrr�<module>s

F1le Man4ger