add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
�

��Vc�$cs��dZddlZddlZddlZddlmZddlmZddlm	Z	dZ
Gd�d	e��ZGd
�dej
��ZGd�d
e��ZdS)z
Running tests�N�)�result)�_SubTest)�registerResultTcs&�eZdZdZd�Zd�Zdd�ZdS)�_WritelnDecoratorz@Used to decorate file-like objects with a handy 'writeln' methodcs�||_dS�N)�stream)�selfr�  �(/usr/lib64/python3.11/unittest/runner.py�__init__z_WritelnDecorator.__init__s
�������csR�|dvrt|���t|j|��S)N)rZ__getstate__)�AttributeError�getattrr)rZattrr	r
�__getattr__z_WritelnDecorator.__getattr__s0���-�-�	'� ��&�&�&��t�{�4�(�(�(rNcs^�|r|�|��|�d��dS�N�
)�write)rZargr	r
�writelnz_WritelnDecorator.writelns1���	��J�J�s�O�O�O��
�
�4�����rr)�__name__�
__module__�__qualname__�__doc__rrr�rr
rrsL������J�J����)�)�)�
�����rrcs���eZdZdZdZdZ�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----------------------------------------------------------------------cs���tt|���|||��||_|dk|_|dk|_||_d|_dS)NrT)�superrrr�showAll�dots�descriptions�_newline)rrr�	verbosity�	__class__�    �r
rzTextTestResult.__init__&sU���
�n�d�#�#�,�,�V�\�9�M�M�M���� �1�}�����N��	�(�����
�
�
rcs��|���}|jr&|r$d�t|��|f��St|��Sr)ZshortDescriptionr�joinZstr)r�testZdoc_first_line�   r
�getDescriptionzTextTestResult.getDescription.sN���.�.�0�0����	��	��9�9�c�$�i�i��8�9�9�9��t�9�9�rcs8��tt|���|��|jri|j�|�|����|j�d��|j���d|_dSdS)N� ... F)	rr�	startTestrrrr%�flushr�rr#r �  �r
r'zTextTestResult.startTest5s����
�n�d�#�#�-�-�d�3�3�3��<�	"��K���d�1�1�$�7�7�8�8�8��K���g�&�&�&��K������!�D�M�M�M�		"�	"rcs��t|t��}|s|jr�|js|j���|r|j�d��|j�|�|����|j�d��|j�|��|j���d|_dS)Nz  r&T)Z
isinstancerrrrrr%r()rr#ZstatusZ
is_subtests    r
�
_write_statuszTextTestResult._write_status=s�����h�/�/�
��	'���	'��=�
&���#�#�%�%�%��
(���!�!�$�'�'�'��K���d�1�1�$�7�7�8�8�8��K���g�&�&�&�����F�#�#�#����������
�
�
rcs���|��|jrIt|d|j��r|�|d��n�|�|d��np|jrit|d|j��r|j�d��n|j�d��|j���tt|���
|||��dS)Nr�FAIL�ERROR�F�E)rZ
issubclassZfailureExceptionr+rrrr(rr�
addSubTest)rr#Zsubtest�errr r!r
r0zTextTestResult.addSubTestJs�����	$��|�

$��c�!�f�g�&>�?�?�9��&�&�w��7�7�7�7��&�&�w��8�8�8�8���
$��c�!�f�g�&>�?�?�+��K�%�%�c�*�*�*�*��K�%�%�c�*�*�*���!�!�#�#�#�
�n�d�#�#�.�.�t�W�c�B�B�B�B�Brcs��tt|���|��|jr|�|d��dS|jr5|j�d��|j���dSdS)NZokz.)	rr�
addSuccessrr+rrrr(r)r*r
r2zTextTestResult.addSuccessYs����
�n�d�#�#�.�.�t�4�4�4��<�	 ����t�T�*�*�*�*�*�
�Y�	 ��K���c�"�"�"��K��������	 �	 rc���tt|���||��|jr|�|d��dS|jr5|j�d��|j���dSdS)Nr-r/)	rr�addErrorrr+rrrr(�rr#r1r �   �r
r4zTextTestResult.addErroras����
�n�d�#�#�,�,�T�3�7�7�7��<�	 ����t�W�-�-�-�-�-�
�Y�	 ��K���c�"�"�"��K��������	 �	 rcr3)Nr,r.)	rr�
addFailurerr+rrrr(r5r6r
r7zTextTestResult.addFailureis����
�n�d�#�#�.�.�t�S�9�9�9��<�	 ����t�V�,�,�,�,�,�
�Y�	 ��K���c�"�"�"��K��������	 �	 rcs6��tt|���||��|jr+|�|d�|����dS|jr5|j�d��|j�	��dSdS)Nz
skipped {0!r}�s)
rr�addSkiprr+Zformatrrrr()rr#Zreasonr r6r
r9zTextTestResult.addSkipqs����
�n�d�#�#�+�+�D�&�9�9�9��<�	 ����t�_�%;�%;�F�%C�%C�D�D�D�D�D�
�Y�	 ��K���c�"�"�"��K��������	 �	 rcsJ��tt|���||��|jr5|j�d��|j���dS|jr5|j�d��|j���dSdS)Nzexpected failureZx)	rr�addExpectedFailurerrrr(rrr5r6r
r:z!TextTestResult.addExpectedFailureys����
�n�d�#�#�6�6�t�S�A�A�A��<�	 ��K��� 2�3�3�3��K��������
�Y�	 ��K���c�"�"�"��K��������	 �	 rcsH��tt|���|��|jr5|j�d��|j���dS|jr5|j�d��|j���dSdS)Nzunexpected successZu)	rr�addUnexpectedSuccessrrrr(rrr)r*r
r;z#TextTestResult.addUnexpectedSuccess�s����
�n�d�#�#�8�8��>�>�>��<�	 ��K��� 4�5�5�5��K��������
�Y�	 ��K���c�"�"�"��K��������	 �	 rcs��|js|jr2|j���|j���|�d|j��|�d|j��t|dd��}|ro|j�|j	��|D]2}|j�d|�
|�������3|j���dSdS)Nr-r,�unexpectedSuccessesrzUNEXPECTED SUCCESS: )rrrrr(�printErrorList�errors�failuresr�
separator1r%)rr<r#r$r
�printErrorszTextTestResult.printErrors�s���9�	 ���	 ��K���!�!�!��K���������G�T�[�1�1�1����F�D�M�2�2�2�%�d�,A�2�F�F���	 ��K�����0�0�0�+�
X�
X����#�#�$V�4�;N�;N�t�;T�;T�$V�$V�W�W�W�W��K��������		 �	 rcsb�|D]�\}}|j�|j��|j�|�d|�|������|j�|j��|j�d|z��|j�����dS)Nz: z%s)rrr@r%�
separator2r()rZflavourr>r#r1s     r
r=zTextTestResult.printErrorList�s����	 �	 �I�D�#��K�����0�0�0��K���G�G�G�D�4G�4G��4M�4M�4M� N�O�O�O��K�����0�0�0��K����s�
�+�+�+��K�������	 �	 r)rrrrr@rBrr%r'r+r0r2r4r7r9r:r;rAr=Z
__classcell__)r s@r
rrsW����������J��J���������"�"�"�"�"����
C�
C�
C�
C�
C� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � rrcs4�eZdZdZeZ		d
dd�d�Zd�Zd	�ZdS)�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.
    NTrF)�	tb_localscs��|�tj}t|��|_||_||_||_||_||_||_	|�	||_
dSdS)z�Construct a TextTestRunner.

        Subclasses should accept **kwargs to ensure compatibility as the
        interface changes.
        N)�sysZstderrrrrr�failfast�bufferrD�warnings�resultclass)	rrrrrFrGrIrHrDs	         r
rzTextTestRunner.__init__�sm���	 ��Z�F�'��/�/���(���"��� ��
����"��� ��
��	+�*�D����	+�	+rcsN�|�|j|j|j��Sr)rIrrr)rs r
�_makeResultzTextTestRunner._makeResult�s!�������T�->���O�O�Orcs��|���}t|��|j|_|j|_|j|_tj��5|jr>tj|j��|jdvrtjdtd���tj��}t|dd��}|�
|��	||��t|dd��}|�
|��n##t|dd��}|�|��wwxYwtj��}ddd��n#1swxYwY||z
}|j
��t|d��r|j�|j��|j}|j�d	||d
krdpd|fz��|j���d
x}	x}
}	t't(|j|j|jf��}|\}	}
}n#t0$rYnwxYwg}
|j��sw|j�d��t)|j��t)|j��}}|r|
�d|z��|r|
�d|z��n|j�d��|r|
�d|z��|	r|
�d|	z��|
r|
�d|
z��|
r2|j�dd�|
���d���n|j�d��|j���|S)z&Run the given test case or test suite.)ZdefaultZalwaysZmodulezPlease use assert\w+ instead.)ZcategoryZmessage�startTestRunN�stopTestRunrBzRan %d test%s in %.3fsrr8�rZFAILEDzfailures=%dz	errors=%dZOKz
skipped=%dzexpected failures=%dzunexpected successes=%dz (z, z)r) rJrrFrGrDrHZcatch_warningsZsimplefilterZfilterwarningsZDeprecationWarning�timeZperf_counterrrAZhasattrrrrBZtestsRunZmapZlenZexpectedFailuresr<�skippedr
Z
wasSuccessfulrr?r>Zappendr"r()rr#rZ	startTimerKrLZstopTimeZ	timeTaken�runZ
expectedFailsr<rOZresultsZinfosZfailedZerroreds                r
rPzTextTestRunner.run�s���!�!�#�#���v�����-������
��>���
�
$�
&�
&�	+�	+��}�
F��%�d�m�4�4�4��=�$9�9�F��+�H�%7�$D�F�F�F�F��)�+�+�I�"�6�>�4�@�@�L��
������
"���V����%�f�m�T�B�B���"��K�M�M�M���&�f�m�T�B�B���"��K�M�M�M�M�"�����(�*�*�H�/	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+����	+�	+�	+�	+�0�y�(�	��������6�<�(�(�	3��K���� 1�2�2�2��o������4� �#��(�"2�s�"8�b�)�D�E�	F�	F�	F��������89�9�
�9�+�g�	B��#�� 7� &� :� &�� 0�1�1�G�;B�7�M�.�����	�	�	��D�	����
��#�v�#�%�%�	$��K���h�'�'�'�!�&�/�2�2�C��
�4F�4F�G�F��
5����]�V�3�4�4�4��
4����[�7�2�3�3�3���K���d�#�#�#��	1��L�L���/�0�0�0��	A��L�L�/�-�?�@�@�@��	J��L�L�2�5H�H�I�I�I��	$��K����4�9�9�U�+;�+;�+;�+;� =�>�>�>�>��K���d�#�#�#���������
s=�A6D=�C;�D=�; D�D=�=E�E�'H�
H�H)NTrFFNN)	rrrrrrIrrJrPrrr
rCrC�sr��������
!�K�AB�JN�+�#�+�+�+�+�+�(P�P�P�G�G�G�G�GrrC)rrErNrHrMrZcaserZsignalsrZ
__unittestZobjectrZ
TestResultrrCrrr
�<module>rQs�����
�
�
�
���������������������#�#�#�#�#�#�
�
�
�
�
�
�
��
�
�
� @ �@ �@ �@ �@ �V�&�@ �@ �@ �Ff�f�f�f�f�V�f�f�f�f�fr