Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_yield_from.cpython-311.pyc |
�
�Ke`x � � � d Z ddlZddlZddlmZmZmZ ddlmZ G d� dej � � Z
edk r ej � � dS 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 �� � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d � Z"d!� Z#d"� Z$d#S )$�TestPEP380Operationz
Test semantics.
c � ��� g ���fd�}�fd�� |� � D ]}�� d|��� � �| � �g d�� � dS )zH
Test delegation of initial next() call to subgenerator
c 3 � �K � �� d� � � � � E d {V �� �� d� � d S �N�Starting g1�Finishing g1��append��g2�traces ���>/usr/local/apps/python3/lib/python3.11/test/test_yield_from.py�g1zOTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g1 sH �� � � ��L�L��'�'�'��r�t�t�O�O�O�O�O�O�O��L�L��(�(�(�(�(� c 3 �h �K � � � d� � dV � � � d� � d S )N�Starting g2�* �Finishing g2r �r s �r r zOTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator.<locals>.g2 s: �� � � ��L�L��'�'�'��H�H�H��L�L��(�(�(�(�(r �Yielded )r r z
Yielded 42r r
N�r �assertEqual��selfr �xr r s @@r �/test_delegation_of_initial_next_to_subgeneratorzCTestPEP380Operation.test_delegation_of_initial_next_to_subgenerator s� ��� � �� )� )� )� )� )� )� )� )� )� )� )� ���� .� .�A��L�L�L���,�-�-�-�-�����
�
�
� � � � � r c �> ��� g ���fd�}�fd�� |� � D ]}�� d|��� � � | � d� � n8# t $ r+}| � |j d d� � Y d}~nd}~ww xY w| � �g d�� � dS ) z?
Test raising exception in initial next() call
c 3 � �K � �� d� � � � � E d {V �� �� d� � d S # �� d� � w xY wr r r s ��r r zKTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g11 se �� � � �
-����]�+�+�+��2�4�4�����������^�,�,�,�,�,�����^�,�,�,�,���s �%A �Ac � �� � � d� � t d� � �# � � d� � w xY w)Nr �spanish inquisition occurredr �r �
ValueErrorr s �r r zKTestPEP380Operation.test_raising_exception_in_initial_next_call.<locals>.g27 sB �� �
-����]�+�+�+� �!?�@�@�@�����^�,�,�,�,���s �$'