%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/unittest/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/unittest/__pycache__/runner.cpython-312.pyc

�

���f�(���dZddlZddlZddlZddlmZddlmZddlm	Z	dZ
Gd�d	e�ZGd
�dej�ZGd�d
e�Zy)z
Running tests�N�)�result)�_SubTest)�registerResultTc�$�eZdZdZd�Zd�Zdd�Zy)�_WritelnDecoratorz@Used to decorate file-like objects with a handy 'writeln' methodc��||_y�N)�stream)�selfrs  �&/usr/lib/python3.12/unittest/runner.py�__init__z_WritelnDecorator.__init__s	�����c�L�|dvrt|��t|j|�S)N)r�__getstate__)�AttributeError�getattrr)r�attrs  r
�__getattr__z_WritelnDecorator.__getattr__s'���-�-� ��&�&��t�{�{�4�(�(rNc�L�|r|j|�|jd�y�N�
)�write)r�args  r
�writelnz_WritelnDecorator.writelns����J�J�s�O��
�
�4�rr
)�__name__�
__module__�__qualname__�__doc__rrr�rr
rrs��J��)�
rrc���eZdZdZdZdZdd��fd�
Zd�Z�fd�Zd	�Z	�fd
�Z
�fd�Z�fd�Z�fd
�Z
�fd�Z�fd�Z�fd�Zd�Zd�Z�xZS)�TextTestResultzhA test result class that can print formatted text results to a stream.

    Used by TextTestRunner.
    zF======================================================================zF----------------------------------------------------------------------N��	durationsc���tt|�|||�||_|dkD|_|dk(|_||_d|_||_y)zwConstruct a TextTestResult. Subclasses should accept **kwargs
        to ensure compatibility as the interface changes.rTN)	�superr"rr�showAll�dots�descriptions�_newliner$)rrr)�	verbosityr$�	__class__s     �r
rzTextTestResult.__init__&sK���	�n�d�,�V�\�9�M���� �1�}�����N��	�(�����
�"��rc��|j�}|jr|rdjt|�|f�St|�Sr)�shortDescriptionr)�join�str)r�test�doc_first_lines   r
�getDescriptionzTextTestResult.getDescription1s=���.�.�0�������9�9�c�$�i��8�9�9��t�9�rc���tt|�|�|jrg|jj|j
|��|jjd�|jj�d|_yy)N� ... F)	r&r"�	startTestr'rrr3�flushr*�rr1r,s  �r
r6zTextTestResult.startTest8sd���
�n�d�-�d�3��<�<��K�K���d�1�1�$�7�8��K�K���g�&��K�K����!�D�M�	rc���t|t�}|s|jr�|js|jj	�|r|jjd�|jj|j
|��|jjd�|jj	|�|jj�d|_y)Nz  r5T)�
isinstancerr*rrrr3r7)rr1�status�
is_subtests    r
�
_write_statuszTextTestResult._write_status@s�����h�/�
������=�=����#�#�%�����!�!�$�'��K�K���d�1�1�$�7�8��K�K���g�&������F�#���������
rc���|��|jr?t|d|j�r|j|d�n�|j|d�nv|jrjt|d|j�r|j
j
d�n|j
j
d�|j
j�tt|�+|||�y)Nr�FAIL�ERROR�F�E)r'�
issubclass�failureExceptionr=r(rrr7r&r"�
addSubTest)rr1�subtest�errr,s    �r
rEzTextTestResult.addSubTestMs�����?��|�|��c�!�f�g�&>�&>�?��&�&�w��7��&�&�w��8�����c�!�f�g�&>�&>�?��K�K�%�%�c�*��K�K�%�%�c�*����!�!�#�
�n�d�.�t�W�c�Brc����tt|�|�|jr|j	|d�y|j
r6|jjd�|jj�yy)N�ok�.)	r&r"�
addSuccessr'r=r(rrr7r8s  �r
rKzTextTestResult.addSuccess\sW���
�n�d�.�t�4��<�<����t�T�*�
�Y�Y��K�K���c�"��K�K����rc����tt|�||�|jr|j	|d�y|j
r6|jjd�|jj�yy)Nr@rB)	r&r"�addErrorr'r=r(rrr7�rr1rGr,s   �r
rMzTextTestResult.addErrordsY���
�n�d�,�T�3�7��<�<����t�W�-�
�Y�Y��K�K���c�"��K�K����rc����tt|�||�|jr|j	|d�y|j
r6|jjd�|jj�yy)Nr?rA)	r&r"�
addFailurer'r=r(rrr7rNs   �r
rPzTextTestResult.addFailurelsY���
�n�d�.�t�S�9��<�<����t�V�,�
�Y�Y��K�K���c�"��K�K����rc���tt|�||�|jr"|j	|dj|��y|jr6|jjd�|jj�yy)Nz
skipped {0!r}�s)
r&r"�addSkipr'r=�formatr(rrr7)rr1�reasonr,s   �r
rSzTextTestResult.addSkiptsd���
�n�d�+�D�&�9��<�<����t�_�%;�%;�F�%C�D�
�Y�Y��K�K���c�"��K�K����rc�6��tt|�||�|jr6|jjd�|jj
�y|jr6|jjd�|jj
�yy)Nzexpected failure�x)	r&r"�addExpectedFailurer'rrr7r(rrNs   �r
rXz!TextTestResult.addExpectedFailure|sl���
�n�d�6�t�S�A��<�<��K�K��� 2�3��K�K����
�Y�Y��K�K���c�"��K�K����rc�4��tt|�|�|jr6|jjd�|jj
�y|jr6|jjd�|jj
�yy)Nzunexpected success�u)	r&r"�addUnexpectedSuccessr'rrr7r(rr8s  �r
r[z#TextTestResult.addUnexpectedSuccess�sj���
�n�d�8��>��<�<��K�K��� 4�5��K�K����
�Y�Y��K�K���c�"��K�K����rc��|js|jr4|jj�|jj	�|jd|j�|jd|j�t|dd�}|rt|jj|j�|D]/}|jjd|j|�����1|jj	�yy)Nr@r?�unexpectedSuccessesr zUNEXPECTED SUCCESS: )r(r'rrr7�printErrorList�errors�failuresr�
separator1r3)rr]r1s   r
�printErrorszTextTestResult.printErrors�s����9�9�����K�K���!��K�K�������G�T�[�[�1����F�D�M�M�2�%�d�,A�2�F����K�K������0�+�
X�����#�#�&:�4�;N�;N�t�;T�:U�$V�W�
X��K�K����	rc�z�|D]�\}}|jj|j�|jj|�d|j|����|jj|j�|jjd|z�|jj���y)Nz: z%s)rrrar3�
separator2r7)r�flavourr_r1rGs     r
r^zTextTestResult.printErrorList�s����	 �I�D�#��K�K������0��K�K���G�D�4G�4G��4M� N�O��K�K������0��K�K����s�
�+��K�K����	 r)rrrrrardrr3r6r=rErKrMrPrSrXr[rbr^�
__classcell__)r,s@r
r"r"sY�����J��J�EI�	#��"��
C� � � � � � � � rr"c�:�eZdZdZeZ		d	ddd�d�Zd�Zd�Zd�Z	y)
�TextTestRunnerz�A test runner class that displays results in textual form.

    It prints out the names of tests as they are run, errors as they
    occur, and a summary of the results at the end of the test run.
    NF)�	tb_localsr$c��|�tj}t|�|_||_||_||_||_||_|	|_	||_
|�||_yy)z�Construct a TextTestRunner.

        Subclasses should accept **kwargs to ensure compatibility as the
        interface changes.
        N)�sys�stderrrrr)r+�failfast�bufferrir$�warnings�resultclass)
rrr)r+rmrnrprorir$s
          r
rzTextTestRunner.__init__�sc���>��Z�Z�F�'��/���(���"��� ��
����"���"��� ��
��"�*�D��#rc��	|j|j|j|j|j��S#t
$r4|j|j|j|j�cYSwxYw)Nr#)rprr)r+r$�	TypeError)rs r
�_makeResultzTextTestRunner._makeResult�ss��	4��#�#�D�K�K��1B�1B�$(�N�N�d�n�n�$�N�
N���	4��#�#�D�K�K��1B�1B�$(�N�N�4�
4�	4�s�<?�:A<�;A<c�$�|jsyt|jd�d��}|jdkDr|d|j}|jj	d�t|d�r%|jj	|j�d}|D]@\}}|jdkr|d	krd}�|jj	d
|zd�d|����B|r|jj	d
�y|jj	d�y)Nc��|dS)Nrr )rWs r
�<lambda>z0TextTestRunner._printDurations.<locals>.<lambda>�s
��Q�q�T�rT)�key�reverserzSlowest test durationsrdF�g����MbP?z%.3fs�10� zA
(durations < 0.001s were hidden; use -v to show these durations)�)�collectedDurations�sortedr$rr�hasattrrdr+)rr�ls�hiddenr1�elapseds      r
�_printDurationszTextTestRunner._printDurations�s����(�(��
�F�-�-�>� �"���>�>�A���O�T�^�^�$�B������4�5��6�<�(��K�K���� 1� 1�2����	H�M�D�'��~�~��!�g��o�����K�K���g��.?�� F�G�		H�
��K�K���!B�
C�
�K�K����#rc��|j�}t|�|j|_|j|_|j|_tj�5|j
rtj|j
�tj�}t|dd�}|�|�	||�t|dd�}|�|�	tj�}ddd�z
}|j�|j�|j|�t|d�r%|jj!|j"�|j$}|jj!d||dk7xrdxsd|fz�|jj!�d	x}	x}
}	t't(|j*|j,|j.f�}|\}	}
}g}
|j2�sr|jj5d
�t)|j6�t)|j8�}}|r|
j;d|z�|rS|
j;d|z�n>|d	k(r|s|jj5d
�n|jj5d�|r|
j;d|z�|	r|
j;d|	z�|
r|
j;d|
z�|
r/|jj!ddj=|
��d��n|jj5d�|jj?�|S#t|dd�}|�|�wwxYw#1swY���xYw#t0$rY���wxYw)z&Run the given test case or test suite.�startTestRunN�stopTestRunrdzRan %d test%s in %.3fsrrRr|r�FAILEDzfailures=%dz	errors=%dzNO TESTS RAN�OKz
skipped=%dzexpected failures=%dzunexpected successes=%dz (z, �)r) rsrrmrnriro�catch_warnings�simplefilter�time�perf_counterrrbr$r�rrrrd�testsRun�map�len�expectedFailuresr]�skippedr�
wasSuccessfulrr`r_�appendr/r7)rr1r�	startTimer�r��stopTime�	timeTaken�run�
expectedFailsr]r��results�infos�failed�erroreds                r
r�zTextTestRunner.run�s���!�!�#���v���-�-�������
��>�>���
�
$�
$�
&�	+��}�}��%�%�d�m�m�4��)�)�+�I�"�6�>�4�@�L��'���
"��V��%�f�m�T�B���*��M��(�(�*�H�	+��y�(�	�������>�>�%�� � ��(��6�<�(��K�K���� 1� 1�2��o�o�������4� �#��(�"2�s�"8�b�)�D�E�	F�������89�9�
�9�+�g�	B��#�� 7� 7� &� :� :� &��� 0�1�G�;B�7�M�.����#�v�#�#�%��K�K���h�'�!�&�/�/�2�C��
�
�4F�G�F�����]�V�3�4�����[�7�2�3�
�A�X�g��K�K���n�-��K�K���d�#���L�L���/�0���L�L�/�-�?�@���L�L�2�5H�H�I���K�K���4�9�9�U�+;� =�>��K�K���d�#��������
��e&�f�m�T�B���*��M�+��	+�	+��B�	��	�s7�#AM2�:M�+M2�21M?�M/�/M2�2M<�?	N�N)NTrFFNN)
rrrrr"rprrsr�r�r rr
rhrh�s3���
!�K�AB�JN�+�#�t�+�*4�$�,Drrh)rrkr�ror|r�caser�signalsr�
__unittest�objectr�
TestResultr"rhr rr
�<module>r�sN���
�����#�
�
�
��
� C �V�&�&�C �L@�V�@r

Zerion Mini Shell 1.0