HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_yield_from.cpython-310.opt-1.pyc
o

�i`x�@s^dZddlZddlZddlmZmZmZddlmZGdd�dej	�Z
edkr-e��dSdS)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.
    c�Ng���fdd�}�fdd��|�D]
}��d|f�q|��gd��dS)zH
        Test delegation of initial next() call to subgenerator
        c3�&���d���EdH��d�dS�N�Starting g1�Finishing g1��append���g2�tracer�1/usr/local/lib/python3.10/test/test_yield_from.py�g1��
zOTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g1c3s ���d�dV��d�dS)N�Starting g2�*�Finishing g2rr�rrrrs�
zOTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g2�
Yielded %s)r
rz
Yielded 42rrN�r
�assertEqual��selfr�xrrr�/test_delegation_of_initial_next_to_subgenerators
zCTestPEP380Operation.test_delegation_of_initial_next_to_subgeneratorc
�g���fdd�}�fdd��z|�D]
}��d|f�qWnty:}z|�|jdd�WYd}~n
d}~ww|�d	�|��gd
��dS)z?
        Test raising exception in initial next() call
        c	3s6�z��d���EdHW��d�dS��d�wr	rrrrrr1s
�
zKTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g1c	s z	��d�td����d�w)Nr�spanish inquisition occurredr�r
�
ValueErrorrrrrr7s
zKTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g2rrr!N�'subgenerator failed to raise ValueError)r
rrr�r
r#r�args�fail�rrr�errr�+test_raising_exception_in_initial_next_call,s
���
z?TestPEP380Operation.test_raising_exception_in_initial_next_callcr)z@
        Test delegation of next() call to subgenerator
        c3s2���d�dV��EdHdV��d�dS�Nr
�g1 ham�g1 eggsrrrrrrrPs�
zLTestPEP380Operation.test_delegation_of_next_call_to_subgenerator.<locals>.g1c3s&���d�dVdV��d�dS�Nr�g2 spam�g2 more spamrrrrrrrVs
�
zLTestPEP380Operation.test_delegation_of_next_call_to_subgenerator.<locals>.g2r)r
�Yielded g1 hamr�Yielded g2 spam�Yielded g2 more spamr�Yielded g1 eggsrNrrrrr�,test_delegation_of_next_call_to_subgeneratorKs
z@TestPEP380Operation.test_delegation_of_next_call_to_subgeneratorc
r )zA
        Test raising exception in delegated next() call
        c	3�B�z��d�dV��EdHdVW��d�dS��d�wr+rrrrrrm��
zMTestPEP380Operation.test_raising_exception_in_delegated_next_call.<locals>.g1c	3s(�z��d�dVtd����d�w)Nrr/�hovercraft is full of eelsr0rr"rrrrrus�
zMTestPEP380Operation.test_raising_exception_in_delegated_next_call.<locals>.g2rrr8Nr$�r
r1rr2rrr%r(rrr�-test_raising_exception_in_delegated_next_callhs
���
zATestPEP380Operation.test_raising_exception_in_delegated_next_callcs~g���fdd�}�fdd��|�}t|�}d}z	|�|�}��d|f�|d7}qty4Ynw|��gd��dS)	z+
        Test delegation of send()
        c3�R���d�dV}��d|f���EdHdV}��d|f���d�dS�Nr
r,zg1 received %sr-rr�rrrrr���
z7TestPEP380Operation.test_delegation_of_send.<locals>.g1c3sF���d�dV}��d|f�dV}��d|f���d�dS)Nrr/�g2 received %sr0rrr=rrrr�s�
z7TestPEP380Operation.test_delegation_of_send.<locals>.g2�r)r
�
g1 received 1rr2�
g2 received 2r3z
g2 received 3rr4z
g1 received 4rN)�next�sendr
�
StopIterationr)rr�g�yrrrr�test_delegation_of_send�s 
��z+TestPEP380Operation.test_delegation_of_sendcsLg���fdd���fdd����fdd�}|�t|�|��gd��dS)	zA
        Test handling exception while delegating 'send'
        c3r;r<rr=rrrr�r>zMTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.g1c3s*���d�dV}��d|f�td��)Nrr/r?r8r"r=rrrr�s
�
zMTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.g2csX��}t|�}d}z	|�|�}��d|f�|d7}qty+��d�YdSw)Nr@rrE)rCrDr
rE)rFrGr)rrrr�run�s
��zNTestPEP380Operation.test_handling_exception_while_delegating_send.<locals>.run)r
rArr2rBN)�assertRaisesr#r�rrIr�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	3r6r+rrrrrr�r7z5TestPEP380Operation.test_delegating_close.<locals>.g1c	3�6�z��d�dVdVW��d�dS��d�wr.rrrrrr���
z5TestPEP380Operation.test_delegating_close.<locals>.g2�rr9N)�rangerCr
�closer)rrrF�irrrr�test_delegating_close�sz)TestPEP380Operation.test_delegating_closec
s�g���fdd�}�fdd��z|�}td�D]}t|�}��d|f�q|��Wn"tyM}z|�|jdd�|�|jt	�WYd	}~n
d	}~ww|�
d
�|��gd��d	S)zB
        Test handling exception while delegating 'close'
        c	3r6r+rrrrrr	r7zMTestPEP380Operation.test_handing_exception_while_delegating_close.<locals>.g1c	3s@�z��d�dVdVW��d�td����d�td��)Nrr/r0r�"nybbles have exploded with delightr"rrrrrs�


�zMTestPEP380Operation.test_handing_exception_while_delegating_close.<locals>.g2rPrrrUNr$r9)rQrCr
rRr#rr&�assertIsInstance�__context__�
GeneratorExitr'�rrrFrSrr)rrr�-test_handing_exception_while_delegating_closes ��
zATestPEP380Operation.test_handing_exception_while_delegating_closec
s�g���fdd�}�fdd��z!|�}td�D]}t|�}��d|f�qtd�}|�|�WntyK}z|�|jdd�WYd	}~n
d	}~ww|�d
�|��gd��d	S)z)
        Test delegating 'throw'
        c	3r6r+rrrrrr2r7z5TestPEP380Operation.test_delegating_throw.<locals>.g1c	3rNr.rrrrrr:rOz5TestPEP380Operation.test_delegating_throw.<locals>.g2rPr�tomato ejectedrNr$r9�rQrCr
r#�throwrr&r'rYrrr�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)rrr�pexZszPTestPEP380Operation.test_value_attribute_of_StopIteration_exception.<locals>.pex�spam�eggs)zStopIteration: zvalue = None�StopIteration: spamzvalue = spamrezvalue = eggsN)rErar)rrbr)rrr�/test_value_attribute_of_StopIteration_exceptionUszCTestPEP380Operation.test_value_attribute_of_StopIteration_exceptioncs,�fdd�}dd��|�t|��dg�dS)Nc3����EdHdS�Nrr�rrrrp��z:TestPEP380Operation.test_exception_value_crash.<locals>.g1css�dVdgS)Nrrrrrrrrrs�z:TestPEP380Operation.test_exception_value_crash.<locals>.g2r)r�list)rrrrir�test_exception_value_crashmsz.TestPEP380Operation.test_exception_value_crashcsPg���fdd�}d�fdd�	�|�D]
}��d|f�q|��gd��dS)	z-
        Test generator return value
        c3st���d�dV��EdH}��d|f�ddtd�fD]}�|�EdH}��d|f�qdV��d�dS)	Nr
r,zg2 returned %rr@�rP�r-r)r
rE)�ret�vrrrr}s�
z;TestPEP380Operation.test_generator_return_value.<locals>.g1Nc3s.���d�dVdV��d�|r|SdSr.r�rprrrr�s�

�z;TestPEP380Operation.test_generator_return_value.<locals>.g2r)r
r1rr2r3rzg2 returned Nonerr2r3rz
g2 returned 1rr2r3rzg2 returned (2,)rr2r3rzg2 returned StopIteration(3)r4rrhrrrrr�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
        cs��td�EdHdS�Nrn�rQrrrrrF���zGTestPEP380Operation.test_delegation_of_next_to_non_generator.<locals>.gr)�	Yielded 0�	Yielded 1�	Yielded 2Nr)rrrFrrrr�(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()
        csrsrtrurrrrrF�rvzBTestPEP380Operation.test_conversion_of_sendNone_to_next.<locals>.grnN�Yielded: %s)z
Yielded: 0z
Yielded: 1z
Yielded: 2)rQrDr
r)rrrF�girrGrrr�#test_conversion_of_sendNone_to_next�s
z7TestPEP380Operation.test_conversion_of_sendNone_to_nextcspg��fdd�}|�}t|�t��}|��Wd�n1s!wY|�|��d�|��ddg�dS)z=
        Test delegation of close() to non-generator
        c	3�B�z��d�td�EdH��d�W��d�dS��d�w�N�
starting grnzg should not be here�finishing g�r
rQrrrrrF���
zHTestPEP380Operation.test_delegation_of_close_to_non_generator.<locals>.gN�r�r�)rCrrRr�getvalue)rrFr|�outputrrr�)test_delegation_of_close_to_non_generator�s
�
�z=TestPEP380Operation.test_delegation_of_close_to_non_generatorc
s�g��fdd�}z!|�}td�D]}t|�}��d|f�qtd�}|�|�WntyD}z|�|jdd�WYd}~n
d}~ww|�d�|��gd	��dS)
z:
        Test delegating 'throw' to non-generator
        c	3s8�z��d�td�EdHW��d�dS��d�w)N�
Starting g�
�Finishing gr�rrrrrF�s
�
zETestPEP380Operation.test_delegating_throw_to_non_generator.<locals>.g�rr[rNr$)r�rwrxryz	Yielded 3z	Yielded 4r�r\)rrFr|rSrr)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�qWnty@}z|�d|jd�WYd}~n
d}~ww|�d	�|��d
dg�dS)z:
        Test attempting to send to non-generator
        c	3r~rr�rrrrrFr�zGTestPEP380Operation.test_attempting_to_send_to_non_generator.<locals>.grnrzShould not have yielded: %srDrNz#was able to send into non-generatorr�r�)	rCrQrDr
�AttributeErrorZassertInr&r'r)rrFr|rrGr)rrr�(test_attempting_to_send_to_non_generators$
���

�z<TestPEP380Operation.test_attempting_to_send_to_non_generatorcs
Gdd�d���fdd�}|�t��|�}|�t|�d�|�d�Wd�n1s-wY|�t��|�}|�t|�d�|�t�Wd�n1sRwYt��� }|�}|�t|�d�|�	�|�t|j
j�Wd�dS1s~wYdS)zG
        Test subiterator with a broken getattr implementation
        c@s$eZdZdd�Zdd�Zdd�ZdS)z@TestPEP380Operation.test_broken_getattr_handling.<locals>.BrokencS�|Srhr�rrrr�__iter__"�zITestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__iter__cS�dS)Nr@rr�rrr�__next__$r�zITestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__next__cSsdddS�Nr@rr)r�attrrrr�__getattr__&szLTestPEP380Operation.test_broken_getattr_handling.<locals>.Broken.__getattr__N)r`�
__module__�__qualname__r�r�r�rrrr�Broken!sr�c3rgrhrr�r�rrrF)rjz;TestPEP380Operation.test_broken_getattr_handling.<locals>.gr@N)rJ�ZeroDivisionErrorrrCrDr]r�rZcatch_unraisable_exceptionrRZ
unraisable�exc_type)rrFr|�cmrr�r�test_broken_getattr_handlings$��
"�z0TestPEP380Operation.test_broken_getattr_handlingcsDg���fdd��dd���fdd�}|�t|�|��dg�dS)	z7
        Test exception in initial next() call
        c3r)N�g1 about to yield from g2�g1 should not be hererrrrrrBrzCTestPEP380Operation.test_exception_in_initial_next_call.<locals>.g1css�ddVdSr�rrrrrrF��zCTestPEP380Operation.test_exception_in_initial_next_call.<locals>.g2cs��}t|�dSrh)rC)r|�rrrrIHszDTestPEP380Operation.test_exception_in_initial_next_call.<locals>.runr�N)rJr�rrKrrLr�#test_exception_in_initial_next_call=s
�z7TestPEP380Operation.test_exception_in_initial_next_callc
s�g���fdd�}��fdd��z|���D]
}��d|f�qWnty=}z|�|jdd�WYd}~n
d}~ww|�d	�|��gd
��dS)z0
        Test attempted yield-from loop
        c3s6���d�dV��d���EdH��d�dS)N�g1: startingZy1�g1: about to yield from g2r�rrrrrrUs�

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


z>TestPEP380Operation.test_attempted_yield_from_loop.<locals>.g2r{rzgenerator already executingNz$subgenerator didn't raise ValueError)r�zYielded: y1r�r�zYielded: y2r�r%)rrrGr)r)rr|rr�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�q9|��gd
��dS)z=
        Test returning value from delegated 'throw'
        c	3r6r+rrrrrrxr7zITestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.g1c3sJ�z��d�dVdVWdS�y$��d�dVdVYdSw)Nrr/r0�Caught LunchError in g2zg2 lunch savedzg2 yet more spamrr)�
LunchErrorrrrr�s�

�zITestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.g2c@�eZdZdS)zQTestPEP380Operation.test_returning_value_from_delegated_throw.<locals>.LunchErrorN�r`r�r�rrrrr���r�rPrr[)r
r1rr2r�zYielded g2 yet more spamr4rN)�	ExceptionrQrCr
r]rrYr)r�rrr�)test_returning_value_from_delegated_throwss	
z=TestPEP380Operation.test_returning_value_from_delegated_throwc�Vg���fdd�}�fdd��|d�|d�|d�|td��|��gd	��dS)
z1
        Test next and return with value
        c
sj�|�}t|�z��d�t|���d�WdSty4}z��d|f�WYd}~dSd}~ww)N�f resuming g�f SHOULD NOT BE HERE�f caught %r)rCr
rE��rr|r)�rFrrr�f�s
��z>TestPEP380Operation.test_next_and_return_with_value.<locals>.fc3s&���d�dV��d|f�|S)N�
g starting�g returning %rr)r�rrrrF�s
�
z>TestPEP380Operation.test_next_and_return_with_value.<locals>.gNr@rmrn)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))�rEr�rr�rr�r�test_next_and_return_with_value�s	z3TestPEP380Operation.test_next_and_return_with_valuecr�)
z1
        Test send and return with value
        c
sl�|�}t|�z��d�|�d���d�WdSty5}z��d|f�WYd}~dSd}~ww)N�f sending spam to grcr�r�)rCr
rDrEr�r�rrr��s

��z>TestPEP380Operation.test_send_and_return_with_value.<locals>.fc3s6���d�dV}��d|f���d|f�|S)Nr�z
g received %rr�r)r�rrrrrF�s�
z>TestPEP380Operation.test_send_and_return_with_value.<locals>.gNr@rmrn)r�r��g received 'spam'r�r�r�r�r�r�r�r�r�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]'�g�|�}��t|����t|�t���|��ddd	�ft��g�qd
S)ze
        Test catching an exception thrown into a
        subgenerator and returning a value
        c3s.�zdVW�Sty��d�Y�Sw)Nr@�inner caught ValueError)r#r
r)rrarr�inner�s���zTTestPEP380Operation.test_catching_exception_from_subgen_and_returning.<locals>.innerc3s(���EdH}��d|f�|VdS)N�inner returned %r to outerrrq)r�rrr�outers�
zTTestPEP380Operation.test_catching_exception_from_subgen_and_returning.<locals>.outerrPrmr@r�r�N)rEr
rC�reprr]r#r�rr�rFr)r�rrar�1test_catching_exception_from_subgen_and_returning�s��zETestPEP380Operation.test_catching_exception_from_subgen_and_returningcslg��fdd����fdd�}z|�}t|�|�t�Wn	ty&Ynw|�d�|��ddg�dS)	zo
        Test throwing GeneratorExit into a subgenerator that
        catches it and returns normally.
        c3s8�z��d�dV��d�WdStyYdSw�N�Enter f�Exit f�r
rXrrrrr�s�
�zSTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns.<locals>.fc3r�N�Enter gzExit grr�r�rrrrF!rzSTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returns.<locals>.g�*subgenerator failed to raise GeneratorExitr�r�N)rCr]rXr'r)rrFr|rr�r�4test_throwing_GeneratorExit_into_subgen_that_returnss�

�zHTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_returnsc
s�g��fdd����fdd�}z|�}t|�|�t�Wnty8}z|�|jdd�WYd}~n
d}~ww|�d�|��d	d
g�dS)ze
        Test throwing GeneratorExit into a subgenerator that
        catches it and yields.
        c3s>�z��d�dV��d�WdStydVYdSwr�r�rrrrr�8s�
�zXTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields.<locals>.fc3rr�rrr�rrrF?rzXTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yields.<locals>.grzgenerator ignored GeneratorExitNr�r�r�)rCr]rX�RuntimeErrorrr&r'�rrFr|r)rr�r�9test_throwing_GeneratorExit_into_subgenerator_that_yields2s ��

�zMTestPEP380Operation.test_throwing_GeneratorExit_into_subgenerator_that_yieldsc
s�g��fdd����fdd�}z|�}t|�|�t�Wn"ty?}z|�|jdd�|�|jt�WYd}~n
d}~ww|�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�WdStytd��w)Nr�r��Vorpal bunny encountered)r
rXr#rrrrr�Vs�
�zRTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raises.<locals>.fc3rr�rrr�rrrF]rzRTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raises.<locals>.grr�Nr$r�r�)	rCr]rXr#rr&rVrWr'r�rr�r�3test_throwing_GeneratorExit_into_subgen_that_raisesPs"��

�zGTestPEP380Operation.test_throwing_GeneratorExit_into_subgen_that_raisescCsdd�}|�tt|��dS)Ncss�dEdHdS)NrrrrrrrFpr�z4TestPEP380Operation.test_yield_from_empty.<locals>.g)rJrErC)rrFrrr�test_yield_from_emptyosz)TestPEP380Operation.test_yield_from_emptycs0�fdd�}�fdd��|����t��gd��|��t��g}z
	|���d��q#ty4Ynw��|gd��Gdd	�d	t����fd
d�}��fdd��|��t��g}z
	|������q]tynYn��|gd���G��fdd
�d
t���fdd�}|��t����	�dS)Nc3s�dV��EdHdVdS�Nrrnrr)�tworr�onevs�
zOTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.onec3s4�dVz�EdHWn	tyYnwdVdS�Nr@rP�r#rr�rrr�zs��
zOTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.two)rr@rPrnTrc@r�)zQTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyErrNr�rrrr�MyErr�r�r�c3sN�zdVWn	�yYnw��EdHzdVWdS�y&YdSwr�rr)r�r�rrr��s�
��c3sd�zdVWn	�yYnwz�EdHWn	ty YnwzdVWdS�y1YdSwr�r�r)r�rrrr��s �
���cs*eZdZdd�Zdd�Z��fdd�ZdS)zPTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyItcSr�rhrr�rrrr��r�zYTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.__iter__cSr��Nrrr�rrrr��r�zYTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.__next__cs���j���tt��dSrh)�
assertTrue�
gi_runningrJr#rC)Zself_�rrrrrR�szVTestPEP380Operation.test_delegating_generators_claim_to_be_running.<locals>.MyIt.closeN)r`r�r�r�r�rRrr�rr�MyIt�sr�c3rgrhrr)r�rrr��rj)
rrkrCr
rDrEr�r]�objectrR)rr��resr)r�r�rrr�r�.test_delegating_generators_claim_to_be_runningtsB
��

�zBTestPEP380Operation.test_delegating_generators_claim_to_be_runningcspdd���fdd�}dd�}dd�}||��D]	}|�d	|v�q|||���D]
}|�d	|vo3d
|v�q(dS)NcSsdd�t��D�S)NcSsg|]}|d�qS)rnr)�.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��VdSrhrr�r�rr�gen�s�zFTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.gencs��|EdHdSrhr�rFrrrrc�r�zGTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.spamcsr�rhrr�rrrrd�r�zGTestPEP380Operation.test_delegator_is_visible_to_debugger.<locals>.eggsrcrd)r�)rr�rcrdr�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>.MyItercSr�rhrr�rrrr��r�zHTestPEP380Operation.test_custom_iterator_return.<locals>.MyIter.__iter__cSstd��r�)rEr�rrrr��szHTestPEP380Operation.test_custom_iterator_return.<locals>.MyIter.__next__N)r`r�r�r�r�rrrr�MyIter�sr�c3s���EdH�dSrhrr�r�rorrr��s�z<TestPEP380Operation.test_custom_iterator_return.<locals>.genr)rkr)rr�rr�r�test_custom_iterator_return�s

z/TestPEP380Operation.test_custom_iterator_returncs|dd���fdd�}dd�}t��#|�}|�}|�d�|�|�|�|�~~t�Wd�dS1s7wYdS)Ncss�dVdSrhrrrrr�	innermost�s�
zDTestPEP380Operation.test_close_with_cleared_frame.<locals>.innermostc3s�dV}��EdHdSrhr)�	outer_gen�r�rrr��s�z@TestPEP380Operation.test_close_with_cleared_frame.<locals>.innercss�dV}|EdHdSrhr)�	inner_genrrrr��s�z@TestPEP380Operation.test_close_with_cleared_frame.<locals>.outer)rrDr)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>.MyGencSr�rhrr�rrrr�r�zQTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.__iter__cSr�r�rr�rrrr�r�zQTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.__next__cs|�dSrhr)rZwhatrqrrrDszMTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.MyGen.sendN)r`r�r�r�r�rDrrqrr�MyGensr�c3s���EdH}dSrhrrq)r�rrr�rjzHTestPEP380Operation.test_send_tuple_with_custom_generator.<locals>.outer)r@rPrn�)rCrDrr�r)r�rpr�%test_send_tuple_with_custom_generator	s	
z9TestPEP380Operation.test_send_tuple_with_custom_generatorN)%r`r�r��__doc__rr*r5r:rHrMrTrZr^rfrlrrrzr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrsF%,)")(3  #+*/K'r�__main__)
rZunittestr�Ztest.supportrrr�testrZTestCaserr`�mainrrrr�<module>s"�