Your IP : 3.133.148.222


Current Path : /opt/alt/python311/lib64/python3.11/unittest/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/unittest/__pycache__/suite.cpython-311.opt-1.pyc

�

c��f�4���dZddlZddlmZddlmZdZd�ZGd�d	e��ZGd
�de��Z	Gd�de��Z
d
�ZGd�de��ZdS)�	TestSuite�N�)�case)�utilTc�>�t||d���}|��dS)Nc��dS�N�r
��5/opt/alt/python311/lib64/python3.11/unittest/suite.py�<lambda>z!_call_if_exists.<locals>.<lambda>s���r)�getattr)�parent�attr�funcs   r�_call_if_existsrs$���6�4���.�.�D��D�F�F�F�F�Frc�Z�eZdZdZdZdd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�ZdS)�
BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures.
    Tr
c�L�g|_d|_|�|��dS�Nr)�_tests�_removed_tests�addTests)�self�testss  r�__init__zBaseTestSuite.__init__s)���������
�
�e�����rc�\�dtj|j���dt|���d�S)N�<z tests=�>)r�strclass�	__class__�list�rs r�__repr__zBaseTestSuite.__repr__s+���"&�-���"?�"?�"?�"?��d�����L�Lrc�z�t||j��stSt|��t|��kSr	)�
isinstancer!�NotImplementedr")r�others  r�__eq__zBaseTestSuite.__eq__s3���%���0�0�	"�!�!��D�z�z�T�%�[�[�(�(rc�*�t|j��Sr	)�iterrr#s r�__iter__zBaseTestSuite.__iter__"s���D�K� � � rc�P�|j}|D]}|r||���z
}�|Sr	)r�countTestCases)r�cases�tests   rr.zBaseTestSuite.countTestCases%s=���#���	/�	/�D��
/���,�,�.�.�.����rc�@�t|��s/td�t|�������t	|t
��r0t
|tjtf��rtd���|j
�|��dS)Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest())�callable�	TypeError�format�reprr&�type�
issubclassr�TestCaserr�append�rr0s  r�addTestzBaseTestSuite.addTest,s�����~�~�	E��0�7�7��T�
�
�C�C�D�D�D��d�D�!�!�	@�j��26�-��1K�'M�'M�	@��?�@�@�
@�����4� � � � � rc��t|t��rtd���|D]}|�|���dS)Nz0tests must be an iterable of tests, not a string)r&�strr3r;)rrr0s   rrzBaseTestSuite.addTests6sR���e�S�!�!�	P��N�O�O�O��	�	�D��L�L������	�	rc��t|��D]5\}}|jrn(||��|jr|�|���6|Sr	)�	enumerate�
shouldStop�_cleanup�_removeTestAtIndex)r�result�indexr0s    r�runzBaseTestSuite.run<s\��$�T�?�?�	/�	/�K�E�4�� �
����D��L�L�L��}�
/��'�'��.�.�.���
rc��	|j|}t|d��r"|xj|���z
c_d|j|<dS#t$rYdSwxYw)z2Stop holding a reference to the TestCase at index.r.N)r�hasattrrr.r3)rrDr0s   rrBz BaseTestSuite._removeTestAtIndexEs~��
	&��;�u�%�D��t�-�.�.�
=��#�#�t�':�':�'<�'<�<�#�#�!%�D�K�������	�	�	��D�D�	���s�
A
�
A�Ac��|j|i|��Sr	�rE)r�args�kwdss   r�__call__zBaseTestSuite.__call__Ss���t�x��&��&�&�&rc�8�|D]}|����dS)�7Run the tests without collecting errors in a TestResultN)�debugr:s  rrOzBaseTestSuite.debugVs*���	�	�D��J�J�L�L�L�L�	�	rN)r
)�__name__�
__module__�__qualname__�__doc__rArr$r)r,r.r;rrErBrLrOr
rrrrs����������H�����
M�M�M�)�)�)�
!�!�!����!�!�!�������&�&�&�'�'�'�����rrc�R�eZdZdZd
d�Zd�Zd�Zd�Zd�Z	dd	�Z		dd
�Z
d�Zd�ZdS)ra�A test suite is a composite test consisting of a number of TestCases.

    For use, create an instance of TestSuite, then add test case instances.
    When all tests have been added, the suite can be passed to a test
    runner, such as TextTestRunner. It will run the individual test cases
    in the order in which they were added, aggregating the results. When
    subclassing, do not forget to call the base class constructor.
    Fc�l�d}t|dd��dur	dx|_}t|��D]�\}}|jrn�t	|��rv|�||��|�||��|�||��|j|_	t|jdd��st|dd��r��|s||��n|�
��|jr|�|����|r2|�d|��|�
|��d|_|S)NF�_testRunEnteredT�_classSetupFailed�_moduleSetUpFailed)rrVr?r@�_isnotsuite�_tearDownPreviousClass�_handleModuleFixture�_handleClassSetUpr!�_previousTestClassrOrArB�_handleModuleTearDown)rrCrO�topLevelrDr0s      rrEz
TestSuite.runfsb�����6�,�e�4�4��=�=�04�4�F�"�X�$�T�?�?�	/�	/�K�E�4�� �
����4� � �
��+�+�D�&�9�9�9��)�)�$��7�7�7��&�&�t�V�4�4�4�,0�N��)��D�N�,?��G�G���F�$8�%�@�@����
���V������
�
�����}�
/��'�'��.�.�.���	+��'�'��f�5�5�5��&�&�v�.�.�.�%*�F�"��
rc�N�t��}|�|d��dS)rNTN)�_DebugResultrE)rrOs  rrOzTestSuite.debug�s%���������������rc���t|dd��}|j}||krdS|jrdSt|dd��rdSd}	d|_n#t$rYnwxYwt|dd��}t|dd��}|��t|d��		|��nt#t$rg}t|t��r�d}	d|_n#t$rYnwxYwtj
|��}	|�||d|	��Yd}~nd}~wwxYw|r6|�4|��|jD]"}
|�||
dd|	|
�	���#t|d
��dS#t|d
��wxYwdS)Nr]�__unittest_skip__F�
setUpClass�doClassCleanups�_setupStdoutTr��info�_restoreStdout)
rr!rXrWr3r�	Exceptionr&rarr �"_createClassOrModuleLevelException�tearDown_exceptions)rr0rC�
previousClass�currentClass�failedrdre�e�	className�exc_infos           rr\zTestSuite._handleClassSetUp�s8����(<�d�C�C�
��~���=�(�(��F��$�	��F��<�!4�e�<�<�	��F���	�-2�L�*�*���	�	�	�
�D�	����
�\�<��>�>�
�!�,�0A�4�H�H���!��F�N�3�3�3�
:�
G��J�L�L�L�L�� �G�G�G�!�&�,�7�7���!�F��9=��6�6��$���������� $�
�l� ;� ;�I��;�;�F�A�<H�<E�G�G�G�G�G�G�G�G�����G�����/�o�9�#�O�%�%�%�$0�$D�/�/���?�?� &����\�9�%-�@�/�/�/�/� ��(8�9�9�9�9�9����(8�9�9�9�9����1"�!sf�A�
A�A�
B�E�
D
�#D�<C�D�
C�D�C�/D�E�D
�
;E�E)c�>�d}t|dd��}|�|j}|S)Nr])rrQ)rrC�previousModulerms    r�_get_previous_modulezTestSuite._get_previous_module�s-������(<�d�C�C�
��$�*�5�N��rc��|�|��}|jj}||krdS|�|��d|_	t
j|}n#t$rYdSwxYwt|dd��}|��t|d��		|��nL#t$r?}t|t��r�d|_|�
||d|��Yd}~nd}~wwxYw|jrD	tj��n/#t$r"}|�
||d|��Yd}~nd}~wwxYwt|d��dS#t|d��wxYwdS)NF�setUpModulerfTri)rur!rQr^rX�sys�modules�KeyErrorrrrjr&rarkr�doModuleCleanups)rr0rCrt�
currentModule�modulerwrps        rr[zTestSuite._handleModuleFixture�s���2�2�6�:�:����1�
��N�*�*��F��"�"�6�*�*�*�%*��!�	��[��/�F�F���	�	�	��F�F�	�����f�m�T�:�:���"��F�N�3�3�3�
:�K��K�M�M�M�M�� �K�K�K�!�&�,�7�7���04�F�-��;�;�F�A�<I�<I�K�K�K�K�K�K�K�K�����	K�����,�O�O��-�/�/�/�/��$�O�O�O��?�?���@M�@M�O�O�O�O�O�O�O�O�����O����
 ��(8�9�9�9�9�9����(8�9�9�9�9����)#�"sl�A�
A(�'A(�
B�E�
C$�%5C�E�C$�$
E�/D�E�
D/�
D*�%E�*D/�/E�ENc�F�|�d|�d�}|�||||��dS)Nz (�))�_addClassOrModuleLevelException)rrC�exc�method_namerrh�	errorNames       rrkz,TestSuite._createClassOrModuleLevelException�s8��"�/�/�f�/�/�/�	��,�,�V�S�)�T�J�J�J�J�Jrc�6�t|��}t|dd��}|�5t|tj��r||t|����dS|s)|�|tj����dS|�||��dS)N�addSkip)	�_ErrorHolderrr&r�SkipTestr=�addErrorrxrr)rrC�	exceptionr�rh�errorr�s       rr�z)TestSuite._addClassOrModuleLevelException�s����Y�'�'���&�)�T�2�2����:�i���#G�#G���G�E�3�y�>�>�*�*�*�*�*��
-�����s�|�~�~�6�6�6�6�6�����t�,�,�,�,�,rc�|�|�|��}|�dS|jrdS	tj|}n#t$rYdSwxYwt|d��	t
|dd��}|�Q	|��nE#t$r8}t|t��r�|�
||d|��Yd}~nd}~wwxYw	tj��nE#t$r8}t|t��r�|�
||d|��Yd}~nd}~wwxYwt|d��dS#t|d��wxYw)Nrf�tearDownModuleri)
rurXrxryrzrrrjr&rarkrr{)rrCrtr}r�rps      rr^zTestSuite._handleModuleTearDown�s����2�2�6�:�:���!��F��$�	��F�	��[��0�F�F���	�	�	��F�F�	����	���/�/�/�	6�$�V�-=�t�D�D�N��)�L�"�N�$�$�$�$�� �L�L�L�!�&�,�7�7����;�;�F�A�<L�<J�L�L�L�L�L�L�L�L�����L����
H��%�'�'�'�'���
H�
H�
H��f�l�3�3����7�7���8H�8F�H�H�H�H�H�H�H�H�����
H����
�F�$4�5�5�5�5�5��O�F�$4�5�5�5�5���so�7�
A�A�D)�-
A8�7D)�8
B:�.B5�0D)�5B:�:D)�>C�D)�
D�.D�
D)�D�D)�)D;c��t|dd��}|j}||ks|�dSt|dd��rdSt|dd��rdSt|dd��rdSt|dd��}t|dd��}|�|�dSt|d��	|�e	|��nY#t$rL}t	|t
��r�t
j|��}|�||d|��Yd}~nd}~wwxYw|�e|��|j	D]S}	t	|t
��r|	d	�t
j|��}|�||	d	d||	�
���Tt|d��dS#t|d��wxYw)Nr]rWFrXrc�
tearDownClassrerfrrgri)
rr!rrjr&rarr rkrl)
rr0rCrmrnr�rerprqrrs
          rrZz TestSuite._tearDownPreviousClasss%����(<�d�C�C�
��~���=�(�(�M�,A��F��=�"5�u�=�=�	��F��6�/��7�7�	��F��=�"5�u�=�=�	��F��
���E�E�
�!�-�1B�D�I�I��� �_�%<��F����/�/�/�	6��(�G�!�M�O�O�O�O�� �G�G�G�!�&�,�7�7��� $�
�m� <� <�I��;�;�F�A�<K�<E�G�G�G�G�G�G�G�G�����	G�����*���!�!�!� -� A�K�K�H�!�&�,�7�7�*�&�q�k�)� $�
�m� <� <�I��;�;�F�H�Q�K�<K�<E�AI�<�K�K�K�K�

�F�$4�5�5�5�5�5��O�F�$4�5�5�5�5���s8�E5�
B#�"E5�#
C9�-AC4�/E5�4C9�9A*E5�5F)Fr	)
rPrQrRrSrErOr\rur[rkr�r^rZr
rrrr\s�������������B���,:�,:�,:�\���#:�#:�#:�L9=�K�K�K�K�.2�
-�
-�
-�
-�!6�!6�!6�F(6�(6�(6�(6�(6rc�F�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS)r�z�
    Placeholder for a TestCase inside a result. As far as a TestResult
    is concerned, this looks exactly like a unit test. Used to insert
    arbitrary errors into a test suite run.
    Nc��||_dSr	��description)rr�s  rrz_ErrorHolder.__init__Ts��&����rc��|jSr	r�r#s r�idz_ErrorHolder.idWs����rc��dSr	r
r#s r�shortDescriptionz_ErrorHolder.shortDescriptionZs���trc��d|j�d�S)Nz<ErrorHolder description=rr�r#s rr$z_ErrorHolder.__repr__]s���15�1A�1A�1A�C�Crc�*�|���Sr	)r�r#s r�__str__z_ErrorHolder.__str__`s���w�w�y�y�rc��dSr	r
�rrCs  rrEz_ErrorHolder.runcs	��	
�rc�,�|�|��Sr	rIr�s  rrLz_ErrorHolder.__call__hs���x�x����rc��dSrr
r#s rr.z_ErrorHolder.countTestCasesks���qr)
rPrQrRrS�failureExceptionrr�r�r$r�rErLr.r
rrr�r�Hs�����������'�'�'� � � ����D�D�D����
�
�
�
 � � �����rr�c�J�	t|��n#t$rYdSwxYwdS)z?A crude way to tell apart testcases and suites with duck-typingTF)r+r3)r0s rrYrYns;����T�
�
�
�
�������t�t������5s��
 � c��eZdZdZdZdZdZdS)razCUsed by the TestSuite to hold previous class when running in debug.NF)rPrQrRrSr]rXr@r
rrraraws%������I�I������J�J�Jrra)
rSrx�rr�
__unittestr�objectrrr�rYrar
rr�<module>r�s����
�
�
�
�������������
�
����
I�I�I�I�I�F�I�I�I�Xi6�i6�i6�i6�i6�
�i6�i6�i6�X$�$�$�$�$�6�$�$�$�L��������6�����r

?>