%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/test/libregrtest/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/test/libregrtest/__pycache__/testresult.cpython-312.pyc

�

���fX����dZddlZddlZddlZddlZddlZddlZddlmZGd�dej�Z
Gd�d�Zdd�Zdd	�Z
ed
k(�rddlmcmZde
_Gd�d
ej(�Zej,�Zej1ej2�j5e��ej6�Zeed�ej<D���Zeej@�Z!e!jEe�Z#e$dejK��e$dd��ejLe#jO��D]Z(e$e(jS�d���e$�yy)z=Test runner and result class for the regression test suite.

�N)�supportc���eZdZdZ�fd�Zed��Z�fd�Zdd�Zed��Z	�fd�Z
�fd�Z�fd	�Z�fd
�Z
�fd�Z�fd�Zd
�Z�xZS)�RegressionTestResultFc�`��t�|�|||rdnd��d|_|jr}ddlm}ddlm}m}||_|jd�|_
|jjd|j|�jd�	�jd
��d|_d|_y)N�r)�stream�descriptions�	verbosityT)�ElementTree)�datetime�UTC�	testsuite�start)�tzinfo� )�super�__init__�buffer�USE_XML�	xml.etreerrr
�_RegressionTestResult__ET�Element�_RegressionTestResult__suite�set�now�replace�	isoformat�_RegressionTestResult__e�!_RegressionTestResult__start_time)�selfrr	r
�ETrr
�	__class__s       ��2/usr/lib/python3.12/test/libregrtest/testresult.pyrzRegressionTestResult.__init__s����
����\�(1�1�q�	�	:�����<�<�3�.��D�I�%�2�:�:�k�2�D�L��L�L���W�%�\�\�#�.�&-�g�T�g�&:�&/�i��n�
6��D�H� ���c��	|j}	|�S#t$rt|�cYSwxYw#t$rt|�cYSwxYw�N)�id�AttributeError�str�	TypeError�repr)�cls�test�test_ids   r#�__getIdzRegressionTestResult.__getId sR��	��g�g�G�	 ��9����	��t�9��	���	 ��w�<��	 �s��0�-�-�A�Ac����t�|�|�|jr-|jj	|j
d�x|_}tj�|_	y)N�testcase)
r�	startTestrr�
SubElementrr�time�perf_counterr)r r-�er"s   �r#r2zRegressionTestResult.startTest,sI���
���$���<�<��9�9�/�/����j�I�I�D�H�q� �-�-�/��r$c	�$�|jsy|j}d|_|�y|j}|jd|j	d|j|���|jd|j	dd��|jd|j	dd��|jr3|jdtj�|jz
d��|r�|j�@|jj�j�}||j|d�_
|j�@|jj�j�}||j|d	�_
|j�D]�\}}	|r|	s�|j||�}
t!|	d
�rG|	j�D]3\}}|r|
j|t#|���$t#|�|
_
�5�qt#|	�|
_
��y)N�name�status�run�result�	completedr4z0.6fz
system-outz
system-err�items)rrrr�pop�_RegressionTestResult__getIdrr4r5�_stdout_buffer�getvalue�rstripr3�text�_stderr_bufferr=�hasattrr))
r r-�capture�argsr6r!�stdout�stderr�k�v�e2�k2�v2s
             r#�_add_resultz RegressionTestResult._add_result2s����|�|���H�H������9��
�Y�Y��	���f�d�h�h�v�t�|�|�D�'9�:�;�	���h�����5�1�2�	���h�����;�7�8����
�E�E�&�T�.�.�0�4�3D�3D�D�T�J�L���"�"�.��,�,�5�5�7�>�>�@��6<�
��
�
�a��.�3��"�"�.��,�,�5�5�7�>�>�@��6<�
��
�
�a��.�3��J�J�L�	!�D�A�q��A������q�!�$�B��q�'�"��g�g�i�*�F�B������r�3�r�7�+�"%�b�'���	*��a�&���	!r$c�L�t|t�r8|jdk(r
|j}n'|j�d|j��}nt	|�}tj||d�}tj|||�}|dj|�dj|�d�S)N�builtins�.�)�type�messagerS)�
isinstancerT�
__module__�__name__r+�	traceback�format_exception�join)r,�err_type�	err_value�err_tb�typename�msg�tbs       r#�__makeErrorDictz$RegressionTestResult.__makeErrorDictVs����h��%��"�"�j�0�#�,�,��&�1�1�2�!�H�4E�4E�3F�G���H�~�H��(�(��9�d�C��
�
'�
'��)�V�
D����w�w�s�|������
�	
r$c�h��|j|d|j|���t�|�
||�y)NT)�error)rO�$_RegressionTestResult__makeErrorDictr�addError�r r-�errr"s   �r#rfzRegressionTestResult.addErroris5�������t�+?�4�+?�+?��+E��F�
����s�#r$c�h��|j|d|j|���t�|�
||�y)NT)�output)rOrer�addExpectedFailurergs   �r#rkz'RegressionTestResult.addExpectedFailurems5�������t�,@�D�,@�,@�#�,F��G�
��"�4��-r$c���|j|d|j|���t�|�
||�tj
r|j
�yy)NT)�failure)rOrer�
addFailurer�failfast�stoprgs   �r#rnzRegressionTestResult.addFailureqsL�������t�-A�T�-A�-A�3�-G��H�
���4��%�����I�I�K�r$c�L��|j||��t�|�	||�y)N)�skipped)rOr�addSkip)r r-�reasonr"s   �r#rszRegressionTestResult.addSkipws$�������v��.�
����f�%r$c�F��|j|�t�|�	|�yr&)rOr�
addSuccess�r r-r"s  �r#rvzRegressionTestResult.addSuccess{s��������
���4� r$c�J��|j|d��t�|�	|�y)N�UNEXPECTED_SUCCESS)�outcome)rOr�addUnexpectedSuccessrws  �r#r{z)RegressionTestResult.addUnexpectedSuccesss$�������';��<�
��$�T�*r$c�N�|jstd��|j}|jdt	|j
��|jdt	t
|j���|jdt	t
|j���|S)NzUSE_XML is false�tests�errors�failures)	r�
ValueErrorrrr)�testsRun�lenr~r)r r6s  r#�get_xml_elementz$RegressionTestResult.get_xml_element�sr���|�|��/�0�0��L�L��	���g�s�4�=�=�)�*�	���h��C����,�-�.�	���j�#�c�$�-�-�0�1�2��r$�F)rXrW�__qualname__rr�classmethodr?r2rOrerfrkrnrsrvr{r��
__classcell__)r"s@r#rr
sc����G�!� �	��	�0�"!�H�
��
�$$�.��&�!�+�r$rc��eZdZdd�Zd�Zy)�QuietRegressionTestRunnerc�J�t|dd�|_||j_y)Nr)rr;r)r rrs   r#rz"QuietRegressionTestRunner.__init__�s��*�6�4��;���#����r$c�>�||j�|jSr&)r;)r r-s  r#r:zQuietRegressionTestRunner.run�s���T�[�[���{�{�r$Nr�)rXrWr�rr:�r$r#r�r��s��$�r$r�c��|r+tjtjt||��Stjt
|��S)N)�resultclassrr
)r)�	functools�partial�unittest�TextTestRunnerrr�)r
rs  r#�get_test_runner_classr��s?���� � ��!8�!8�-A�(.�+4�6�	6����6�v�F�Fr$c�&�t||�|�Sr&)r�)rr
�capture_outputs   r#�get_test_runnerr��s��;� ��N�;�F�C�Cr$�__main__Tc�$�eZdZd�Zd�Zd�Zd�Zy)�	TestTestsc��yr&r��r s r#�	test_passzTestTests.test_pass�s��r$c�.�tjd�y)Ng�?)r4�sleepr�s r#�test_pass_slowzTestTests.test_pass_slow�s
���J�J�s�Or$c��tdtj��tdtj��|j	d�y)NrH��filerIzfailure message)�print�sysrHrI�failr�s r#�	test_failzTestTests.test_fail�s+���(����,��(����,��I�I�'�(r$c��tdtj��tdtj��t	d��)NrHr�rIz
error message)r�r�rHrI�RuntimeErrorr�s r#�
test_errorzTestTests.test_error�s)���(����,��(����,���/�/r$N)rXrWr�r�r�r�r�r�r$r#r�r��s��	�	�	)�
	0r$r�c#�&K�|]	}|dk(���y�w)z-vNr�)�.0�as  r#�	<genexpr>r��s����*G��1��9�*G�s�zOutput:zXML: rS)�endr�)*�__doc__r��ior�r4rYr�r-r�TextTestResultrr�r�r�rX�xml.etree.ElementTree�etreerr!r�TestCaser��	TestSuite�suite�addTest�
TestLoader�loadTestsFromTestCase�StringIOr�sum�argv�
runner_clsrH�runnerr:r;r�rA�tostringlistr��s�decoder�r$r#�<module>r�sF����	�
�����}�8�2�2�}�~��G�D��z��&�&�#'�� �0�H�%�%�0�"
�H��� �E�	�M�M�%�(�%�%�'�=�=�i�H�I�
�R�[�[�]�F�&�s�*G�c�h�h�*G�'G�H�J�
��
�
�
#�F�
�Z�Z��
�F�	�)�V�_�_�&�'�	�'�r��
�R�_�_�V�3�3�5�
6�"��
�a�h�h�j�b�!�"�	�G�?r$

Zerion Mini Shell 1.0