????

Your IP : 18.219.68.121


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/reports.cpython-311.pyc

�

�܋fhQ��T�ddlZddlZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
Z
ddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl"m#Z#ddl$m%Z%dd l&m'Z'dd!l&m(Z(dd"l)m*Z*erdd#l+m,Z,dd$l-m.Z.d%�Z/ed&d'�(��Z0Gd)�d'��Z1d*e2d+ee1d,e
fd-�Z3e#Gd.�d/e1����Z4e#Gd0�d1e1����Z5Gd2�d3e��Z6d4ee5e4fd,eee2effd5�Z7d6ee2efd,eee5e4ffd7�Z8d4e1d,ee2effd8�Z9d9ee2efd,ee2effd:�Z:dS);�N)�StringIO)�pprint)�Any)�cast)�Dict)�Iterable)�Iterator)�List)�Mapping)�NoReturn)�Optional)�Tuple)�Type)�
TYPE_CHECKING)�TypeVar)�Union)�ExceptionChainRepr)�
ExceptionInfo)�
ExceptionRepr)�	ReprEntry)�ReprEntryNative)�ReprExceptionInfo��ReprFileLocation)�ReprFuncArgs)�
ReprLocals��
ReprTraceback)�TerminalRepr)�TerminalWriter)�final)�Config)�	Collector)�Item)�skip)�Literal)�CallInfoc���	|jS#t$rP|j}d|ddd�z}d�|d|d||d��x|_}|cYSwxYw)Nz%s.%s.%s�version_info�z[{}] {} -- Python {} {}�id�sysplatform�
executable)�_workerinfocache�AttributeError�
workerinfo�format)�node�d�ver�ss    �`/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/reports.py�getworkerinfoliner7,s�����$�$�������O���1�^�,�R�a�R�0�0��$=�$D�$D�
�d�G�Q�}�%�s�A�l�O�%
�%
�	
��������
���s�	�AA#�"A#�_R�
BaseReport)�boundc��eZdZUeeed<eeeeeefed<ede	e
eeeefeefed<eeeefed<eed<ded<d	e
d
dfd�Zerded
e
fd
�Zded
dfd�Zded
eeeeffd�Zed
efd���Zed
efd���Zed
efd���Zed
efd���Zed
efd���Zed
efd���Zed
efd���Zed
efd���Zed
efd���Zed
eefd���Z de!fd�Z"d
e#ee
ffd�Z$e%de&e'd e#ee(fd
e'fd!���Z)dS)"r9�when�locationN�longrepr�sections�nodeid�&Literal['passed', 'failed', 'skipped']�outcome�kw�returnc�:�|j�|��dS�N)�__dict__�update)�selfrCs  r6�__init__zBaseReport.__init__Es���
���R� � � � � ��keyc��dSrF�)rIrLs  r6�__getattr__zBaseReport.__getattr__Js���CrK�outc�z�t|d��r+t|j��}|r|�|��|j}|�dSt|d��r,tt|��}|�|��dS	t|��}n#t$rd}YnwxYw|�|��dS)Nr2�
toterminalz<unprintable longrepr>)
�hasattrr7r2�liner>rrrR�str�UnicodeEncodeError)rIrP�worker_infor>�longrepr_terminalr5s      r6rRzBaseReport.toterminalMs����4�� � �	&�+�D�I�6�6�K��
&�����%�%�%��=�����F��8�\�*�*�	� $�\�8� <� <���(�(��-�-�-�-�-�
-���M�M����%�
-�
-�
-�,����
-�����H�H�Q�K�K�K�K�Ks�B�B#�"B#�prefixc#�ZK�|jD] \}}|�|��r||fV��!dSrF)r?�
startswith)rIrY�name�contents    r6�get_sectionszBaseReport.get_sectionsasJ����!�]�	&�	&�M�D�'����v�&�&�
&��g�o�%�%�%��	&�	&rKc���t��}t|��}d|_|�|��|���}|���S)zRead-only property that returns the full string representation of
        ``longrepr``.

        .. versionadded:: 3.0
        F)rr �	hasmarkuprR�getvalue�strip)rI�file�tw�excs    r6�longreprtextzBaseReport.longreprtextfsN���z�z��
�D�
!�
!�������������m�m�o�o���y�y�{�{�rKc�f�d�d�|�d��D����S)z_Return captured log lines, if log capturing is enabled.

        .. versionadded:: 3.5
        �
c3� K�|]	\}}|V��
dSrFrN��.0rYr]s   r6�	<genexpr>z$BaseReport.caplog.<locals>.<genexpr>zs7����
�
�)���G�
�
�
�
�
�
rKzCaptured log��joinr^�rIs r6�caplogzBaseReport.caplogtsD���y�y�
�
�-1�->�->�~�-N�-N�
�
�
�
�
�	
rKc�f�d�d�|�d��D����S)zbReturn captured text from stdout, if capturing is enabled.

        .. versionadded:: 3.0
        �c3� K�|]	\}}|V��
dSrFrNrjs   r6rlz'BaseReport.capstdout.<locals>.<genexpr>��7����
�
�)���G�
�
�
�
�
�
rKzCaptured stdoutrmros r6�	capstdoutzBaseReport.capstdout~�E���w�w�
�
�-1�->�->�?P�-Q�-Q�
�
�
�
�
�	
rKc�f�d�d�|�d��D����S)zbReturn captured text from stderr, if capturing is enabled.

        .. versionadded:: 3.0
        rrc3� K�|]	\}}|V��
dSrFrNrjs   r6rlz'BaseReport.capstderr.<locals>.<genexpr>�rtrKzCaptured stderrrmros r6�	capstderrzBaseReport.capstderr�rvrKc��|jdkS)zWhether the outcome is passed.�passed�rBros r6r{zBaseReport.passed�����|�x�'�'rKc��|jdkS)zWhether the outcome is failed.�failedr|ros r6rzBaseReport.failed�r}rKc��|jdkS)zWhether the outcome is skipped.�skippedr|ros r6r�zBaseReport.skipped�s���|�y�(�(rKc�B�|j�d��dS)z3The path portion of the reported node, as a string.z::r)r@�splitros r6�fspathzBaseReport.fspath�s���{� � ��&�&�q�)�)rKc��dS)a6**Experimental** Whether this report should be counted towards the
        totals shown at the end of the test session: "1 passed, 1 failure, etc".

        .. note::

            This function is considered **experimental**, so beware that it is subject to changes
            even in patch releases.
        TrNros r6�count_towards_summaryz BaseReport.count_towards_summary�s	���trKc�.�|j�
|j\}}}|SdS)a�**Experimental** The head line shown with longrepr output for this
        report, more commonly during traceback representation during
        failures::

            ________ Test.foo ________


        In the example above, the head_line is "Test.foo".

        .. note::

            This function is considered **experimental**, so beware that it is subject to changes
            even in patch releases.
        N)r=)rIr��lineno�domains    r6�	head_linezBaseReport.head_line�s$�� �=�$�%)�]�"�F�F�F��M��trK�configc�F�|j�||���\}}}|S)N)�reportr�)�hook�pytest_report_teststatus)rIr��	_category�_short�verboses     r6�_get_verbose_wordzBaseReport._get_verbose_word�s2��%+�[�%I�%I���&J�&
�&
�"�	�6�7��rKc� �t|��S)z�Return the contents of this report as a dict of builtin entries,
        suitable for serialization.

        This was originally the serialize_report() function from xdist (ca03269).

        Experimental method.
        )�_report_to_jsonros r6�_to_jsonzBaseReport._to_json�s���t�$�$�$rK�cls�
reportdictc�0�t|��}|di|��S)aCreate either a TestReport or CollectReport, depending on the calling class.

        It is the callers responsibility to know which class to pass here.

        This was originally the serialize_report() function from xdist (ca03269).

        Experimental method.
        rN)�_report_kwargs_from_json)r�r��kwargss   r6�
_from_jsonzBaseReport._from_json�s#��*�*�5�5���s�}�}�V�}�}�rK)*�__name__�
__module__�__qualname__r
rU�__annotations__r�intrr�
BaseExceptionrr
rrJrrOr rRr	r^�propertyrfrprury�boolr{rr�r�r�r�r"r�rr��classmethodrr8�objectr�rNrKr6r9r9;sU�������
�3�-�����u�S�(�3�-��4�5�6�6�6�6���m�M�*�E�#�s�C�-�,@�#�|�S������5��c��?�#�#�#�#��K�K�K�
5�5�5�5�!�S�!�T�!�!�!�!���	�3�	�3�	�	�	�	��n�������(&�3�&�8�E�#�s�(�O�+D�&�&�&�&�
��c�����X���
��
�
�
��X�
��
�3�
�
�
��X�
��
�3�
�
�
��X�
��(��(�(�(��X�(��(��(�(�(��X�(��)��)�)�)��X�)��*��*�*�*��X�*��	�t�	�	�	��X�	���8�C�=�����X��(������%�$�s�C�x�.�%�%�%�%��
��R��
�d�3��;�.?�
�B�
�
�
��[�
�
�
rK�	type_name�report_classrDc�B�d}t��}td|���td|z|���td|z|���t||���td|z|���td|���t|������)Nz+https://github.com/pytest-dev/pytest/issueszd----------------------------------------------------------------------------------------------------)�streamz.INTERNALERROR: Unknown entry type returned: %szreport_name: %szPlease report this bug at %s)rr�RuntimeErrorra)r�r�r��urlr�s     r6�_report_unserialization_failurer��s���8�C�
�Z�Z�F�
�9�V�$�$�$�$�
�;�i�G�PV�W�W�W�W�
��|�+�F�;�;�;�;�
�:�f�%�%�%�%�
�)�C�/��?�?�?�?�
�9�V�$�$�$�$�
�v���(�(�
)�
)�)rKc�0�eZdZdZdZ					ddedeeeeefde	ee
fd	d
dedee
eeeefeefdd
deeeefdedededeeeeefddfd�Zdefd�Zededdddfd���ZdS)�
TestReportz�Basic test report object (also used for setup and teardown calls if
    they fail).

    Reports can contain arbitrary extra attributes.
    FrNrNr@r=�keywordsrBrAr>r<z$Literal['setup', 'call', 'teardown']r?�duration�start�stop�user_propertiesrDc��||_||_||_||_||_||_t
|pg��|_t
|��|_||_	|	|_
|
|_|j�
|��dSrF)r@r=r�rBr>r<�listr�r?r�r�r�rGrH)
rIr@r=r�rBr>r<r?r�r�r�r��extras
             r6rJzTestReport.__init__�s���$���9A��
�,4��
����!��
���	� $�O�$9�r�:�:����X����
� (��
�"��
���	��
���U�#�#�#�#�#rKc�d�d�|jj|j|j|j��S)Nz <{} {!r} when={!r} outcome={!r}>)r1�	__class__r�r@r<rBros r6�__repr__zTestReport.__repr__9s.��1�8�8��N�#�T�[�$�)�T�\�
�
�	
rK�item�callzCallInfo[None]c
�x�|j}|dksJ�|j}|j}|j}d�|jD��}|j}g}	|jsd}
d}�n t
|t��sd}
|}�nt
|jtj
��r�d}
|���}|�
Jd���|jjrC|�
��dd�\}
}|�J�tj|
��|d	z|jf}nut#|j��|j|jf}nSd}
|jd
kr|�|��}n0|�||j�dd���
��}|jD]#\}}}|	�d|�d|��|f���$||j|j||
|||	||||j���S)z�Create and fill a TestReport with standard item and call info.

        :param item: The item.
        :param call: The call info.
        �collectc��i|]}|d��S)�rN)rk�xs  r6�
<dictcomp>z1TestReport.from_item_and_call.<locals>.<dictcomp>Ks��0�0�0�Q�A�q�0�0�0rKr{Nrr�z=There should always be a traceback entry for skipping a test.�r�r��tbstyle�auto)�stylez	Captured � )r�)r<r�r�r�r��excinfo�
isinstancer�valuer%�	Exception�
_getreprcrash�_use_item_location�
reportinfo�osr��messagerU�pathr��repr_failure�_repr_failure_pyr��	getoption�_report_sections�appendr@r=r�)r�r�r�r<r�r�r�r�r�r?rBr>�rr�rT�rwhenrLr]s                  r6�from_item_and_callzTestReport.from_item_and_call>s���y���y� � � � ��=���
���y��0�0�$�-�0�0�0���,�����|� 	�>F�G��

�H��g�}�5�5�
�"��"����G�M�4�>�:�:�
�#���)�)�+�+���M�M�R�"�M�M��=�3�B�!%���!2�!2�2�A�2�!6�J�D�$��+�+�+�!�y�����q��!�)�C�H�H� #�A�F���Q�X�q�y�A�H�H�"���9��&�&�#�0�0��9�9�H�H�#�4�4��t�{�'<�'<�Y��'O�'O� 5� � �H�$(�#8�	B�	B��E�3���O�O�6��6�6�u�6�6��@�A�A�A�A��s��K��M��������� �0�
�
�
�	
rK)rNrrrN)r�r�r��__doc__�__test__rUrr
r�rrrrr�rr�floatr�rJr�r�r$r�rNrKr6r�r��ss���������H�/1����BF�:$�:$��:$���X�c�]�C�/�0�:$��#�s�(�#�	:$�
:�:$���-�
�.��c�3��m�0D�c�<�W�
�
:$�5�:$��5��c��?�+�:$��:$��:$��:$�"�(�5��f��+=�">�?�:$� 
�!:$�:$�:$�:$�x
�#�
�
�
�
�
�>
�d�>
�2B�>
�|�>
�>
�>
��[�>
�>
�>
rKr�c��eZdZdZdZ	ddedddedeee	ee
efeefd	ee
eeefd
ee	eefddfd�Zedee	eee
effd
���Zdefd�ZdS)�
CollectReportzSCollection report object.

    Reports can contain arbitrary extra attributes.
    r�rNr@rBrAr>N�resultr?rDc��||_||_||_|pg|_t	|��|_|j�|��dSrF)r@rBr>r�r�r?rGrH)rIr@rBr>r�r?r�s       r6rJzCollectReport.__init__�sU��������!��
��l�����X����
��
���U�#�#�#�#�#rKc� �|jd|jfSrF)r�ros r6r=zCollectReport.location�s����T�4�;�/�/rKc�h�d�|jt|j��|j��S)Nz.<CollectReport {!r} lenresult={} outcome={!r}>)r1r@�lenr�rBros r6r�zCollectReport.__repr__�s/��?�F�F��K��T�[�)�)�4�<�
�
�	
rK)rN)r�r�r�r�r<rUrrr�rr�rr
r
r$r#rrJr�r=r�rNrKr6r�r��s��������
�D�/1�$�$��$�:�$���-�
�.��c�3��m�0D�c�<�W�
�	$���e�D�)�O�4�5�6�$��5��c��?�+�$�
�$�$�$�$�>�0�	�%��X�c�]�C�/�0�	1�0�0�0��X�0�

�#�
�
�
�
�
�
rKr�c�.�eZdZdeddfd�Zdeddfd�ZdS)�CollectErrorRepr�msgrDNc��||_dSrF)r>)rIr�s  r6rJzCollectErrorRepr.__init__�s
����
�
�
rKrPc�>�|�|jd���dS)NT)�red)rTr>)rIrPs  r6rRzCollectErrorRepr.toterminal�s �������D��)�)�)�)�)rK)r�r�r�rUrJr rRrNrKr6r�r��sX�������C��D�����*�n�*��*�*�*�*�*�*rKr�r�c��t|ttf��r%|���}|jj|d<|SdS)N�$report_type)r�r�r�r�r�r�)r��datas  r6�pytest_report_to_serializabler��sD���&�:�}�5�6�6����� � ��%�/�8��^�����4rKr�c���d|vro|ddkrt�|��S|ddkrt�|��SJd�|d�����dS)Nr�r�r�Fz(Unknown report_type unserialize data: {})r�r�r�r1)r�s r6�pytest_report_from_serializabler��s����������<�/�/��(�(��.�.�.�
�.�
!�_�
4�
4� �+�+�D�1�1�1�	
�@�G�G��� �
�
�	
�	
�u��4rKc�4����dtttfdttt
ffd��dtdttt
ff�fd��dttdtttt
ffd��dtdttt
ff��fd	�}|j
���}t|j
d
��rQt|j
d��r$t|j
d��r||��|d<n"t	|j
��|d<n
|j
|d<|D]K}t||tj��rtj||��||<�@|dkrd
||<�L|S)z�Return the contents of this report as a dict of builtin entries,
    suitable for serialization.

    This was originally the serialize_report() function from xdist (ca03269).
    �entryrDc���tj|��}|���D],\}}t|d��rtj|��||<�-t	|��j|d�}|S)NrG)�typer�)�dataclasses�asdict�itemsrSr�r�)r�r�rLr��
entry_datas     r6�serialize_repr_entryz-_report_to_json.<locals>.serialize_repr_entry�sr���!�%�(�(���*�*�,�,�	6�	6�J�C���u�j�)�)�
6�'�.�u�5�5��S�	��"�5�k�k�2�D�A�A�
��rK�
reprtracebackc�\��tj|��}�fd�|jD��|d<|S)Nc�&��g|]
}�|����SrNrN)rkr�r�s  �r6�
<listcomp>zE_report_to_json.<locals>.serialize_repr_traceback.<locals>.<listcomp>�s2���!
�!
�!
�()� � ��#�#�!
�!
�!
rK�reprentries)r�r�r�)r�r�r�s  �r6�serialize_repr_tracebackz1_report_to_json.<locals>.serialize_repr_traceback�sJ����#�M�2�2��!
�!
�!
�!
�-:�-F�!
�!
�!
��}���
rK�	reprcrashc�2�|�tj|��SdSrF)r�r�)r�s r6�serialize_repr_crashz-_report_to_json.<locals>.serialize_repr_crash�s ��� ��%�i�0�0�0��4rK�repc�X��|j�J�tt|j��}�|j���|j��|jd�}t
|t��rDg|d<|jD]6\}}}|d�	�|���|��|f���7nd|d<|S)N)r�r�r?�chain)
r>rrr�r�r?r�rrr�)rr>r��repr_traceback�
repr_crash�descriptionrr�s      ��r6�serialize_exception_longreprz5_report_to_json.<locals>.serialize_exception_longrepr�s�����|�'�'�'��
�s�|�4�4��-�-�h�.@�A�A�5�5�h�6L�M�M� �)�"
�"
��
�h� 2�3�3�	#� �F�7�O�;C�>�
�
�7��
�K��w��&�&�0�0��@�@�,�,�Z�8�8�#������
�#�F�7�O��
rKrRr>r�N)rrrrrUrrr
rr9rG�copyrSr>r�r��PathLiker�)r�rr3r\rr�r�s    @@@r6r�r��s��������Y��/�0��	
�c�3�h�������
��$�s�C�x�.���������,�-��	�$�s�C�x�.�	!������*���c�3�h���������.	������A��v���-�-�(��6�?�O�4�4�	1���O�[�:
�:
�	1�9�8��@�@�A�j�M�M����0�0�A�j�M�M����*�
������a��g�r�{�+�+�	��i��$��(�(�A�d�G�G�
�X�
�
��A�d�G���HrKr�c�"����fd���fd�}dttttffd�}�dr�d�dvr�d�dvr�|�dd��}|�dd��}�ddrQg}�ddD]0\}}}|�||��||��|f���1t|��}	nt
||�	��}	�dd
D]}
|	j|
��
|	�d<�S)z�Return **kwargs that can be used to construct a TestReport or
    CollectReport instance.

    This was originally the serialize_report() function from xdist (ca03269).
    c���|d}|d}|dkr~d}d}d}|drtdi|d��}|drtdi|d��}|drt|dd��}t|d||||d�	��}n2|d
krt	|d��}nt|t���|S)Nr�r�r�reprfuncargs�reprfileloc�
reprlocals�linesr�)rr
rrr�rrN)rrrrrr�r�)r�r��
entry_typer
rr�	reprentryr�s       �r6�deserialize_repr_entryz8_report_kwargs_from_json.<locals>.deserialize_repr_entry%s����&�!����'�
���$�$��L��K��J��N�#�
D�+�C�C�d�>�.B�C�C���M�"�
F�.�E�E��m�1D�E�E���L�!�
E�'��\�(:�7�(C�D�D�
�;D��7�m�)�%�'��7�m�<�<�<�I�I��,�
,�
,�'��W�
�6�6�I�I�+�J�
�J�O�O�O��rKc�J���fd�|dD��|d<tdi|��S)Nc�&��g|]
}�|����SrNrN)rkr�rs  �r6r�zP_report_kwargs_from_json.<locals>.deserialize_repr_traceback.<locals>.<listcomp>As2���.
�.
�.
�*+�"�"�1�%�%�.
�.
�.
rKr�rNr)�repr_traceback_dictrs �r6�deserialize_repr_tracebackz<_report_kwargs_from_json.<locals>.deserialize_repr_traceback@sM���.
�.
�.
�.
�/B�=�/Q�.
�.
�.
��M�*��3�3�2�3�3�3rK�repr_crash_dictc�"�|�tdi|��SdS)NrNr)rs r6�deserialize_repr_crashz8_report_kwargs_from_json.<locals>.deserialize_repr_crashFs!���&�#�6�6�o�6�6�6��4rKr>r�r�r)r�r�r?)r
rrUrr�rr�
addsection)r�rrr�r�r�repr_traceback_data�repr_crash_datar�exception_info�sectionrs`          @r6r�r�s����������64�4�4�4�4����c�3�h��0H�����	�:�� 0��:�j�1�1�1��z�*�5�5�5�2�2��z�"�?�3�
�
�
�+�*�:�j�+A�+�+N�O�O�	��j�!�'�*�	��E�EO��F��F�	
�	
�A�#�_�k����2�2�3F�G�G�.�.��?�?�#������#�5�)�)�
�N�/�+�#����N�
"�*�-�j�9�	0�	0�G�%�N�%�w�/�/�/�!/�
�:���rK);r�r��iorr�typingrrrrr	r
rrr
rrrrr�_pytest._code.coderrrrrrrrrrr�_pytest._ior �_pytest.compatr!�_pytest.configr"�
_pytest.nodesr#r$�_pytest.outcomesr%�typing_extensionsr&�_pytest.runnerr'r7r8r9rUr�r�r�r�r�r�r�r�rNrKr6�<module>r*s�������	�	�	�	������������������������������������������������������������������������������� � � � � � �������������1�1�1�1�1�1�,�,�,�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�.�.�.�.�.�.�0�0�0�0�0�0�/�/�/�/�/�/�+�+�+�+�+�+�)�)�)�)�)�)�,�,�,�,�,�,�+�+�+�+�+�+�&�&�&�&�&�&� � � � � � �!�!�!�!�!�!�#�#�#�#�#�#�������!�!�!�!�!�!��(�)�)�)�)�)�)�'�'�'�'�'�'�	�	�	�
�W�T��&�&�&��g�g�g�g�g�g�g�g�T*��*�"&�z�"2�*�
�*�*�*�*��I
�I
�I
�I
�I
��I
�I
���I
�X�0
�0
�0
�0
�0
�J�0
�0
���0
�f*�*�*�*�*�|�*�*�*���-��+�,��
�d�3��8�n�������
�s�C�x�.��
�e�M�:�-�.�/�����F
�J�F
�4��S��>�F
�F
�F
�F
�RP��c�3�h��P�D��c��N�P�P�P�P�P�PrK