%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__/result.cpython-312.pyc

�

���f"��(�ddlZddlZddlmZddlmZmZmZmZm	Z	m
Z
ejd��Gd�d��ZGd	�d
�Z
ejd��Gd�d��ZGd
�dej�Zdeeefdeeeefzfd�Zy)�N)�Any�)�StrJSON�TestName�FilterTuple�format_duration�normalize_test_name�
print_warningT)�slotsc�^�eZdZUdZeed<dZeed<dZeed<ed��Z	ed��Z
d�Zy)	�	TestStatsr�	tests_run�failures�skippedc�|�t|jt|j�t|j��S�N)r
�testsRun�lenrr)�results �./usr/lib/python3.12/test/libregrtest/result.py�
from_unittestzTestStats.from_unittests-�������V�_�_�-��V�^�^�,�.�	.�c�X�t|j|j|j�Sr)r
�	attempted�failedr)�resultss r�from_doctestzTestStats.from_doctests%����*�*� ��� ���*�	*rc��|xj|jz
c_|xj|jz
c_|xj|jz
c_yr)rrr)�self�statss  r�
accumulatezTestStats.accumulates8�����%�/�/�)���
�
����'�
�����
�
�%�rN)�__name__�
__module__�__qualname__r�int�__annotations__rr�staticmethodrrr!�rrr
r

sK���I�s���H�c���G�S���.��.�
�*��*�
&rr
c�l�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZed
��Zed��Zed��Zy)�State�PASSED�FAILED�SKIPPED�UNCAUGHT_EXC�REFLEAK�ENV_CHANGED�RESOURCE_DENIED�INTERRUPTED�
WORKER_FAILED�
WORKER_BUG�DID_NOT_RUN�TIMEOUTc��|tjtjtjtjtj
tjhvSr)r*r,r.r/r3r4r6��states r�	is_failedzState.is_failed1sD����L�L�����M�M��������M�M�
��	rc��|tjtjtjtjtj
tjhvSr)r*r-r1r2r3r4r5r8s r�has_meaningful_durationzState.has_meaningful_duration;sJ����M�M��!�!�������������
��	rc�F�|tjtjhvSr)r*r2r4r8s r�	must_stopzState.must_stopIs&���������
�
�	
rN)r"r#r$r+r,r-r.r/r0r1r2r3r4r5r6r'r:r<r>r(rrr*r*#sx��
�F�
�F��G�!�L��G��K�'�O��K�#�M��J��K��G����������
��
rr*c�,�eZdZUeed<dZedzed<dZedzed<dZ	e
edzed<dZedzed<dZ
e
eeefdzed<dZe
eeefdzed<d	ed
efd�Zd�Zd
efd
�Zd�Zd�Zded	ed
efd�Zd
edzfd�Zdd�Zeded
dfd��Zy)�
TestResult�	test_nameNr9�duration�xml_datar �errorsr�fail_env_changed�returnc�~�|jtjk(r|Stj|j�Sr)r9r*r0r:)rrEs  rr:zTestResult.is_failed^s-���:�:��*�*�*�#�#����t�z�z�*�*rc
��|jri|jr]t|j�}t|j�}d|dkDrdndz}d|dkDrdndz}|j�d|�d|�d|�d|�d	�
S|jr6t|j�}d|dkDrdndz}|j�d|�d|�d	�S|jr6t|j�}d|dkDrdndz}|j�d|�d|�d	�S|j�d
�S)N�errorr�s��failurez	 failed (� z, �)z failed)rDrrrA)r�le�lf�error_s�	failure_ss     r�_format_failedzTestResult._format_failedcs���;�;�4�=�=��T�[�[�!�B��T�]�]�#�B���Q���B�7�G�!�B��F�S��;�I��n�n�%�Y�r�d�!�G�9�B�r�d�!�I�;�a�P�P��;�;��T�[�[�!�B���Q���B�7�G��n�n�%�Y�r�d�!�G�9�A�>�>��=�=��T�]�]�#�B�!�B��F�S��;�I��n�n�%�Y�r�d�!�I�;�a�@�@��.�.�!��)�)rc��|jxtjk(r|j�d�Sxtjk(r|j�Sxtjk(r|j�d�Sxtjk(r|j�d�Sxtjk(r|j�d�Sxtjk(r|j�d�Sxtjk(r|j�d�Sxtjk(r|j�d�Sxtjk(r|j�d�Sxtjk(r|j�d	�Sxtjk(r|j�d
�Stjk(r%|j�dt!|j"��d�S	t%d
��)Nz passedz skippedz failed (uncaught exception)z failed (reference leak)z failed (env changed)z skipped (resource denied)z interruptedz worker non-zero exit codez worker bugz
 ran no testsz timed out (rNzunknown result state: {state!r})r9r*r+rAr,rSr-r.r/r0r1r2r3r4r5r6rrB�
ValueError�rs r�__str__zTestResult.__str__ws{���j�j������.�.�)��1�1������*�*�,�,������.�.�)��2�2�#��#�#��.�.�)�)E�F�F������.�.�)�)A�B�B�"��"�"��.�.�)�)>�?�?�&��&�&��.�.�)�)C�D�D�"��"�"��.�.�)��6�6�$��$�$��.�.�)�)C�D�D�!��!�!��.�.�)��5�5�"��"�"��.�.�)��7�7�����.�.�)��o�d�m�m�6T�5U�UV�W�W�� �!B�C�Crc�@�tj|j�Sr)r*r<r9rVs rr<z"TestResult.has_meaningful_duration�s���,�,�T�Z�Z�8�8rc��|j�|jtjk(rtj|_yyr)r9r*r+r0rVs r�set_env_changedzTestResult.set_env_changed�s-���:�:�����u�|�|�!;��*�*�D�J�"<r�	fail_fastc�l�tj|j�ry|r|j|�ryy)NTF)r*r>r9r:)rr[rEs   rr>zTestResult.must_stop�s*���?�?�4�:�:�&������(8�9��rc	��g}|jxsg}|jxsg}|df|dffD]N\}}|D]D^}}t||��}|�y|s|rdnd}	td|	�d|�d��y|j	|��F�P|syt|�S)	NTF)�is_error�ERROR�FAILzrerun failed to parse z test name: z: don't filter tests)rDrr	r
�append�tuple)
r�match_testsrDr�
error_listr^�	full_name�_�
match_name�
error_types
          r�get_rerun_match_testsz TestResult.get_rerun_match_tests�s��������"����=�=�&�B��
�T�N�
�u��%
�	/� �J��",�

/�
�	�A�0��X�N�
��%��!�,4��&�J�!�$:�:�,�l�%.�M�1E�#G�H���"�"�:�.�

/�		/� ���[�!�!rc�<�tj||t��y)N)�cls)�json�dump�_EncodeTestResult)r�files  r�write_json_intozTestResult.write_json_into�s���	�	�$��"3�4r�worker_jsonc�8�tj|t��S)N)�object_hook)rl�loads�_decode_test_result)rqs r�	from_jsonzTestResult.from_json�s���z�z�+�3F�G�Gr)rFN)r"r#r$rr&r9�strrB�floatrC�listr r
rDrbr�boolr:rSrWr<rZr>rrirpr'rrvr(rrr@r@Qs�����E�3��:��!�H�e�d�l�!�!%�H�d�3�i�$��%�"�E�9�t��"�,0�F�D��s�C�x��!�D�(�/�-1�H�d�5��c��?�#�d�*�1�+�$�+�4�+�
*�(D��D�:9�+��4��4��D��"�{�T�'9�"�25��H�w�H�<�H��Hrr@c�2��eZdZdedeeeff�fd�Z�xZS)rn�orFc���t|t�r0tj|�}|jj
|d<|St�|�|�S)N�__test_result__)�
isinstancer@�dataclasses�asdict�	__class__r"�super�default)rr|rr�s   �rr�z_EncodeTestResult.default�sF����a��$� �'�'��*�F�()���(<�(<�F�$�%��M��7�?�1�%�%r)r"r#r$r�dictrwr��
__classcell__)r�s@rrnrn�s#���&��&��c�3�h��&�&rrn�datarFc�r�d|vr2|jd�|d�tdi|d��|d<tdi|��S|S)Nr~r r()�popr
r@)r�s rruru�sI���D� ����"�#���=�$�%�6��W�
�6�D��M��!�D�!�!��r)r�rl�typingr�utilsrrrrr	r
�	dataclassr
r*r@�JSONEncoderrnr�rwrur(rr�<module>r�s������9�9�
����T�"�&�&�#�&�0+
�+
�\����T�"�nH�nH�#�nH�b&��(�(�&��d�3��8�n���d�3��8�n�1L�r

Zerion Mini Shell 1.0