????

Your IP : 3.147.70.194


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__/junitxml.cpython-311.pyc

�

�܋ftd��~�dZddlZddlZddlZddlZddlmcmZddl	m	Z	ddl
mZddl
mZddl
m
Z
ddl
mZddl
mZdd	l
mZdd
l
mZddlZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl"m#Z#ddl$m%Z%e#d��Z&de'de(fd�Z)d8d�Z*iZ+dddgie+d<dgd�ie+d <e+d�,��e+d!<e*e+d!e+d ��e+de+d"<Gd#�d$��Z-d%ed&e(ddfd'�Z.ej/d%edee(e'gdffd(���Z0ej/d%edee(e'gdffd)���Z1d*e(d+e(ddfd,�Z2ej/d-�.��d%edee(e'gdffd/���Z3d0eddfd1�Z4d2eddfd3�Z5d2eddfd4�Z6d5e(de
e(fd6�Z7Gd7�d��Z8dS)9aReport test results in JUnit-XML format, for use with Jenkins and build
integration servers.

Based on initial code from Ross Lawley.

Output conforms to
https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
�N)�datetime)�Callable)�Dict)�List)�Match)�Optional)�Tuple)�Union)�nodes)�timing)�
ExceptionRepr)�ReprFileLocation)�Config)�filename_arg)�Parser)�FixtureRequest)�
TestReport)�StashKey)�TerminalReporter�LogXML�arg�returnc��dttdtfd�}d}tj||t|����S)a!Visually escape invalid XML characters.

    For example, transforms
        'hello\aworld\b'
    into
        'hello#x07world#x08'
    Note that the #xABs are *not* XML escapes - missing the ampersand &#xAB.
    The idea is to escape visually for the user rather than for XML itself.
    �matchobjrc�d�t|�����}|dkrd|zSd|zS)N�z#x%02Xz#x%04X)�ord�group)r�is  �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/junitxml.py�replzbin_xml_escape.<locals>.repl3s6������ � �!�!����9�9��a�<���a�<��u [^	

 -~€-퟿-�က0-ჿFF])r�str�re�sub)rr!�illegal_xml_res   r �bin_xml_escaper'(sO�� �u�S�z� �c� � � � �	W���6�.�$��C���1�1�1r"c��i}|���D]X\}}|���D]>\}}t|t��stt	|�����||z||<�?�Y|�|��dS�N)�items�
isinstance�list�	TypeError�type�update)�left�right�result�kl�vl�kr�vrs       r �merge_familyr7Cs���
�F��*�*�,�,�!�!���B��k�k�m�m�	!�	!�F�B���b�$�'�'�
*���R���)�)�)��b��F�2�J�J�	!�	�K�K������r"�testcase�	classname�name�_base)�file�line�url�_base_legacy�xunit1�xunit2c	��eZdZdeeefddddfd�Zdejddfd�Z	d	ed
e
ddfd�Zd	ed
e
ddfd�Zde
ejfd
�Zdeddfd�Zdejfd�Zd#dedede
eddfd�Zdeddfd�Zdededefd�Zdedededdfd�Zdeddfd�Zdeddfd�Zdeddfd�Zdeddfd�Zdeddfd �Zdeddfd!�Zd$d"�ZdS)%�
_NodeReporter�nodeid�xmlrrNc��||_||_|jj|_|jj|_d|_g|_g|_i|_dS)N�)�idrE�	add_stats�family�duration�
propertiesr�attrs)�selfrDrEs   r �__init__z_NodeReporter.__init__ZsG����������+����h�o�����
�13���')��
�%'��
�
�
r"�nodec�x�|j�|j��|j�|��dSr))rErI�tagr�append)rNrPs  r rSz_NodeReporter.appendds6������4�8�$�$�$��
���$�����r"r:�valuec�r�|j�t|��t|��f��dSr))rLrSr#r'�rNr:rTs   r �add_propertyz_NodeReporter.add_propertyhs1�������D�	�	�>�%�+@�+@�A�B�B�B�B�Br"c�N�t|��|jt|��<dSr))r'rMr#rVs   r �
add_attributez_NodeReporter.add_attributeks"�� .�u� 5� 5��
�3�t�9�9���r"c��|jrMtjd��}|jD]/\}}|�tjd||������0|SdS�z9Return a Junit node containing custom properties, if any.rL�property�r:rTN)rL�ET�ElementrS�rNrLr:rTs    r �make_properties_nodez"_NodeReporter.make_properties_nodense���?�	���L�1�1�J�#��
R�
R���e��!�!�"�*�Z�d�%�"P�"P�"P�Q�Q�Q�Q����tr"�
testreportc��t|j��}|j}|dd�}|jjr |�d|jj��d�|��t|d��|jdd�}|jd�t|jd��|d<t|d��r
|j|d<||_|j�|��|j
dkrdSi}|j���D],}|t|j
d	vr|j|||<�-||_dS)
N���r�.)r9r:r<�r=r>r@r8)�mangle_test_addressrDrMrE�prefix�insert�joinr'�locationr#�hasattrr>r/rJ�keys�families)rNrb�names�existing_attrs�
classnamesrM�
temp_attrs�keys        r �record_testreportz_NodeReporter.record_testreportwsL��#�J�$5�6�6������3�B�3�Z�
��8�?�	2����a����1�1�1����*�-�-�"�5��9�-�-��'��*�!
�!
��
��q�!�-��
� 3�A� 6�7�7�E�&�M��:�u�%�%�	*�%�>�E�%�L���
��
���.�)�)�)��;�(�"�"��F��
��:�?�?�$�$�	2�	2�C��h�t�{�+�J�7�7�7�"&�*�S�/�
�3�����
�
�
r"c���tjd|jd|jz���}|���}|�|�|��|�|j��|S)Nr8�%.3f)�time)r^r_rMrKrarS�extendr)rNr8rLs   r �to_xmlz_NodeReporter.to_xml�sc���:�j�$�*�6�D�M�;Q�R�R�R���.�.�0�0�
��!��O�O�J�'�'�'�����
�#�#�#��r"rR�message�datac��tj||���}t|��|_|�|��dS)N)rz�r^r_r'�textrS)rNrRrzr{rPs     r �_add_simplez_NodeReporter._add_simple�s=���z�#�w�/�/�/��"�4�(�(��	����D�����r"�reportc��|jjs	|jrdS|j}|j}|j}|jjdkrdSd}|jjdvr|�|d��}|jjdvr2||�|d��z
}|�||d��d}|jjdvr2||�|d	��z
}|�||d
��d}|r|�||d��dSdS)N�no�)�log�allz Captured Log )�
system-out�out-errr�z Captured Out r�)�
system-errr�r�z Captured Err r�)	rE�log_passing_tests�passed�	capstdout�caplog�	capstderr�logging�_prepare_content�_write_content)rNr��content_out�content_log�content_err�content_alls      r �write_captured_outputz#_NodeReporter.write_captured_output�s9���x�)�	�f�m�	��F��&���m���&���8��t�#�#��F����8��~�-�-��/�/��=M�N�N�K��8��?�?�?��4�0�0��>N�O�O�O�K������\�B�B�B��K��8��?�?�?��4�0�0��>N�O�O�O�K������\�B�B�B��K��	C������\�B�B�B�B�B�	C�	Cr"�content�headerc�Z�d�|�dd��|dg��S)N�
�P�-r�)rj�center)rNr�r�s   r r�z_NodeReporter._prepare_content�s)���y�y�&�-�-��C�0�0�'�2�>�?�?�?r"�jheaderc��tj|��}t|��|_|�|��dSr)r})rNr�r�r�rRs     r r�z_NodeReporter._write_content�s8���j��!�!��!�'�*�*������C�����r"c�0�|�d��dS)Nr�)rI�rNr�s  r �append_passz_NodeReporter.append_pass�s�����x� � � � � r"c�@�t|d��r|�dd��dS|j�J�t|jdd��}|�|j}nt|j��}t
|��}|�d|t|j����dS)N�wasxfail�skippedz%xfail-marked test passes unexpectedly�	reprcrash�failure)rlr�longrepr�getattrrzr#r')rNr�r�rzs    r �append_failurez_NodeReporter.append_failure�s����6�:�&�&�	G����Y�(O�P�P�P�P�P��?�.�.�.�4;����d�5�5�I��$�#�+����f�o�.�.��$�W�-�-�G����Y���V�_�1E�1E�F�F�F�F�Fr"c�j�|j�J�|�ddt|j����dS)N�errorzcollection failure)r�rr#r�s  r �append_collect_errorz"_NodeReporter.append_collect_error�s9����*�*�*�����"6��F�O�8L�8L�M�M�M�M�Mr"c�X�|�ddt|j����dS)Nr�zcollection skipped)rr#r�r�s  r �append_collect_skippedz$_NodeReporter.append_collect_skipped�s+������$8�#�f�o�:N�:N�O�O�O�O�Or"c��|j�J�t|jdd��}|�|j}nt|j��}|jdkrd|�d�}nd|�d�}|�dt
|��t|j����dS)Nr��teardownzfailed on teardown with "�"zfailed on setup with "r�)r�r�rzr#�whenrr')rNr�r��reason�msgs     r �append_errorz_NodeReporter.append_error�s�����*�*�*�07��O�[�$�1
�1
�	�� ��&�F�F����)�)�F��;�*�$�$�7�f�7�7�7�C�C�4�6�4�4�4�C�����.��"5�"5�s�6�?�7K�7K�L�L�L�L�Lr"c�6�t|d��rc|j}|�d��r
|dd�}t|��}t	jdd|���}|�|��dSt|jt��sJ�|j\}}}|�d��r
|dd�}|�d	|�d
|��}t	jdd|���}t|��|_
|�|��|�|��dS)Nr�zreason: �r�zpytest.xfail)r.rzz	Skipped: �	�:z: zpytest.skip)rlr��
startswithr'r^r_rSr+r��tupler~r�)rNr��xfailreasonr��filename�lineno�
skipreason�detailss        r �append_skippedz_NodeReporter.append_skipped�s.���6�:�&�&�	/� �/�K��%�%�j�1�1�
.�)�!�"�"�o��(��5�5�K��j����U�U�U�G��K�K�� � � � � ��f�o�u�5�5�5�5�5�+1�?�(�H�f�j��$�$�[�1�1�
,�'����^�
�!�:�:�F�:�:�j�:�:�G��j���
�S�S�S�G�)�'�2�2�G�L��K�K�� � � ��&�&�v�.�.�.�.�.r"c�v��|����|j����fd�|_dS)Nc����Sr)�)r{s�r �<lambda>z(_NodeReporter.finalize.<locals>.<lambda>s���d�r")ry�__dict__�clear)rNr{s @r �finalizez_NodeReporter.finalizes7����{�{�}�}���
������#�l�l�l����r"r)�rN)�__name__�
__module__�__qualname__r
r#rrOr^r_rS�objectrWrYrrartryrr�r�r�r�r�r�r�r�r�r�r�r"r rCrCYs�������(�u�S�*�_�5�(�H�(��(�(�(�(� �2�:� �$� � � � �C��C�V�C��C�C�C�C�6�#�6�f�6��6�6�6�6��h�r�z�&:����� �J� �4� � � � �<��
�������s��S����
��QU�����
C�J�C�4�C�C�C�C�.@��@�S�@�S�@�@�@�@��Z��#����PT�����
!�*�!��!�!�!�!�G�Z�G�D�G�G�G�G� N�:�N�$�N�N�N�N�
P�Z�P�D�P�P�P�P�M�:�M�$�M�M�M�M� /�Z�/�D�/�/�/�/�(#�#�#�#�#�#r"rC�request�fixture_namec���ddlm}|jj�t
d��}|�H|jdvrA|j�|d�	||j�������dSdSdS)z[Emit a PytestWarning about the given fixture being incompatible with newer xunit revisions.r)�
PytestWarningN)r@�legacyzV{fixture_name} is incompatible with junit_family '{family}' (use 'legacy' or 'xunit1'))r�rJ)
�_pytest.warning_typesr��config�stash�get�xml_keyrJrP�warn�format)r�r�r�rEs    r �!_warn_incompatibility_with_xunit2r�s���4�3�3�3�3�3�
�.�
�
"�
"�7�D�
1�
1�C�
��3�:�-A�A�A������M�h�o�o�!-�c�j�p���
�
�	
�	
�	
�	
�	
���A�Ar"c�T��t�d��dtdtddf�fd�}|S)anAdd extra properties to the calling test.

    User properties become part of the test report and are available to the
    configured reporters, like JUnit XML.

    The fixture is callable with ``name, value``. The value is automatically
    XML-encoded.

    Example::

        def test_function(record_property):
            record_property("example_key", 1)
    �record_propertyr:rTrNc�J���jj�||f��dSr))rP�user_propertiesrS)r:rTr�s  �r �append_propertyz(record_property.<locals>.append_property*s&�����$�+�+�T�5�M�:�:�:�:�:r")r�r#r�)r�r�s` r r�r�sQ���&�g�/@�A�A�A�;�c�;�&�;�T�;�;�;�;�;�;��r"c�>�ddlm}|j�|d����t	|d��dt
dtddfd	�}|}|jj�	td��}|�&|�|jj��}|j
}|S)
z�Add extra xml attributes to the tag for the calling test.

    The fixture is callable with ``name, value``. The value is
    automatically XML-encoded.
    r)�PytestExperimentalApiWarningz/record_xml_attribute is an experimental feature�record_xml_attributer:rTrNc��dSr)r�r]s  r �
add_attr_noopz+record_xml_attribute.<locals>.add_attr_noop@s���r")r�r�rPr�r�r#r�r�r�r�r��
node_reporterrDrY)r�r�r��	attr_funcrEr�s      r r�r�0s���C�B�B�B�B�B��L���$�$�%V�W�W����&�g�/E�F�F�F�
�C�
��
�4�
�
�
�
��I�
�.�
�
"�
"�7�D�
1�
1�C�
���)�)�'�,�*=�>�>�
�!�/�	��r"�param�vc��d}t|t��s8d}t|�|t	|��j������dS)zcUsed by record_testsuite_property to check that the given parameter name is of the proper
    type.Tz5{param} parameter needs to be a string, but {g} given)r��gN)r+r#r-r�r.r�)r�r��__tracebackhide__r�s    r �_check_record_param_typer�MsU�����a����E�E����
�
��$�q�'�'�2B�
�C�C�D�D�D�E�Er"�session)�scopec��d}dtdtddfd�}|jj�t
d��}|�|j}|S)a+Record a new ``<property>`` tag as child of the root ``<testsuite>``.

    This is suitable to writing global information regarding the entire test
    suite, and is compatible with ``xunit2`` JUnit family.

    This is a ``session``-scoped fixture which is called with ``(name, value)``. Example:

    .. code-block:: python

        def test_foo(record_testsuite_property):
            record_testsuite_property("ARCH", "PPC")
            record_testsuite_property("STORAGE_TYPE", "CEPH")

    :param name:
        The property name.
    :param value:
        The property value. Will be converted to a string.

    .. warning::

        Currently this fixture **does not work** with the
        `pytest-xdist <https://github.com/pytest-dev/pytest-xdist>`__ plugin. See
        :issue:`7767` for details.
    Tr:rTrNc�*�d}td|��dS)zENo-op function in case --junitxml was not passed in the command-line.Tr:N)r�)r:rTr�s   r �record_funcz.record_testsuite_property.<locals>.record_funcss�� �� ���.�.�.�.�.r")r#r�r�r�r�r��add_global_property)r�r�r�rEs    r �record_testsuite_propertyr�Vsb��6��/�#�/�f�/��/�/�/�/�
�.�
�
"�
"�7�D�
1�
1�C�
���-���r"�parserc���|�d��}|�dddddtjtd���dd�	��|�d
ddddd
���|�ddd���|�ddd���|�dddd���|�ddd���|�ddd ���dS)!Nzterminal reportingz
--junitxmlz--junit-xml�store�xmlpath�path)�optnamez0Create junit-xml style report file at given path)�action�dest�metavarr.�default�helpz
--junitprefixz--junit-prefixr#z0Prepend prefix to classnames in junit-xml output)r�r�r�r��junit_suite_namez Test suite name for JUnit report�pytest)r��
junit_loggingz\Write captured log messages to JUnit report: one of no|log|system-out|system-err|out-err|allr��junit_log_passing_testsz;Capture log information for passing tests to JUnit report: �boolT)r.r��junit_duration_reportz*Duration time to report: one of total|call�total�junit_familyz0Emit XML for schema: one of legacy|xunit1|xunit2rA)�getgroup�	addoption�	functools�partialr�addini)r�rs  r �pytest_addoptionr~sR���O�O�0�1�1�E�	�O�O����
��
�
�|�\�
B�
B�
B��
?��	�	�	�
�O�O������
?�
�����M�M��>�������M�M��	:��	�����M�M�!�E�
��	�����M�M��4������
�M�M��:�������r"r�c��|jj}|r�t|d��s�|�d��}t	||jj|�d��|�d��|�d��||�d����|jt<|j�	|jt��dSdSdS)N�workerinputrr�rrr)
�optionr�rl�getinir�junitprefixr�r��
pluginmanager�register)r�r�rs   r �pytest_configurer�s����m�#�G��=�w�v�}�5�5�=��}�}�^�4�4�� &���M�%��M�M�,�-�-��M�M�/�*�*��M�M�1�2�2���M�M�3�4�4�!
�!
���W��	��%�%�f�l�7�&;�<�<�<�<�<�=�=�=�=r"c��|j�td��}|r)|jt=|j�|��dSdSr))r�r�r�r�
unregister)r�rEs  r �pytest_unconfigurer�sR��
�,�
�
�7�D�
)�
)�C�
�-��L��!���'�'��,�,�,�,�,�-�-r"�addressc��|�d��\}}}|�d��}|d�tjd��|d<tjdd|d��|d<|dxx||zz
cc<|S)N�[z::rrez\.py$r�rd)�	partition�split�replacer�SEPr$r%)rr��possible_open_bracket�paramsros     r rgrg�s���*1�*;�*;�C�*@�*@�'�D�
���J�J�t���E��Q�x����	�3�/�/�E�!�H��v�h��E�!�H�-�-�E�!�H�	�"�I�I�I�&��/�/�I�I�I��Lr"c
�,�eZdZ					d!deededed	ed
eddfd
�Zdeddfd�Zde	eefde
fd�Zdeddfd�Zdede
fd�Z
deddfd�Zdeddfd�Zdeddfd�Zdeddfd�Zd"d�Zd"d�Zdeddfd�Zdededdfd�Zdeejfd �ZdS)#rrr�rr@Trh�
suite_namer��report_durationr�rNc��tj�tj�|����}tj�tj�|����|_||_||_||_	||_
||_||_t�gd�d��|_i|_g|_g|_g|_d|_|jdkr	d|_dSdS)N)r�r�r�r�rr�r@)�osr��
expanduser�
expandvars�normpath�abspath�logfilerhr"r�r�r#rJ�dict�fromkeys�stats�node_reporters�node_reporters_ordered�global_properties�open_reports�cnt_double_fail_tests)rNr*rhr"r�r#rJr�s        r rOzLogXML.__init__�s����'�$�$�R�W�%7�%7��%@�%@�A�A���w�'�'������(@�(@�A�A������$������!2���.������%)�]�]�5�5�5�q�&
�&
��
�

�	
��<>��#�8:���/1���%&��"��;�(�"�"�"�D�K�K�K�#�"r"r�c��t|d|��}t|dd��}|j�||f��}|�|���dSdS�NrDrP)r�r.�popr�)rNr�rD�
workernode�reporters     r r�zLogXML.finalize�se�����6�2�2���V�V�T�2�2�
��&�*�*�F�J�+?�@�@������������ �r"c���t|d|��}t|dd��}||f}||jvr
|j|St||��}||j|<|j�|��|Sr4)r�r.rCr/rS)rNr�rDr6rsr7s      r r�zLogXML.node_reporter�s���)0���6�)J�)J���V�V�T�2�2�
��j� ���$�%�%�%��&�s�+�+� ���.�.��#+���C� ��#�*�*�8�4�4�4��r"rsc�F�||jvr|j|xxdz
cc<dSdS)Nrf)r-)rNrss  r rIzLogXML.add_statss3���$�*����J�s�O�O�O�q� �O�O�O�O�O��r"c�Z�|�|��}|�|��|Sr))r�rt�rNr�r7s   r �
_opentestcasezLogXML._opentestcases.���%�%�f�-�-���"�"�6�*�*�*��r"c������d}�jr7�jdkr*|����}|�����n1�jr��jdkrlt�dd���t�dd���t
���fd�|jD��d��}|r%|�|��|xj	dz
c_	|����}�jdkrL|�
���|j����|js|�
���nG|����n1�jr*|����}|����|�����jdkr�|����}|�
����jD](\}}|�|t)|�����)|����t�dd���t�dd���t
���fd�|jD��d��}|r|j�|��dSdSdS)	aHandle a setup/call/teardown report, generating the appropriate
        XML tags as necessary.

        Note: due to plugins like xdist, this hook may be called in interlaced
        order with reports from other nodes. For example:

        Usual call order:
            -> setup node1
            -> call node1
            -> teardown node1
            -> setup node2
            -> call node2
            -> teardown node2

        Possible call order in xdist:
            -> setup node1
            -> call node1
            -> setup node2
            -> call node2
            -> teardown node2
            -> teardown node1
        N�callr��	worker_id�
item_indexc3��K�|]@}|j�jkr.t|dd���krt|dd���k�<|V��AdS�r@Nr?�rDr���.0�repr��	report_ii�
report_wids  ���r �	<genexpr>z2LogXML.pytest_runtest_logreport.<locals>.<genexpr>9so���������J�&�-�7�7� '��\�4� @� @�I� M� M� '��[�$� ?� ?�:� M� M��
!N� M� M� M�
�r"rfc3��K�|]@}|j�jkr.t|dd���krt|dd���k�<|V��AdSrBrCrDs  ���r rIz2LogXML.pytest_runtest_logreport.<locals>.<genexpr>aso���������
�f�m�3�3�#�C��t�<�<�	�I�I�#�C��d�;�;�z�I�I��
J�I�I�I�
�r")r�r�r<r��failedr��nextr1r�r2r�rSr�r�r�r�r��update_testcase_durationr�rWr#�remove)rNr��close_reportr7�propname�	propvaluerGrHs `    @@r �pytest_runtest_logreportzLogXML.pytest_runtest_logreports������.���=�%	,��{�f�$�$��-�-�f�5�5���$�$�V�,�,�,��
�]�!	,��{�j�(�(�$�V�[�$�?�?�
�#�F�L�$�?�?�	�#�������#'�#4����� � �� �4��M�M�,�/�/�/��.�.�!�3�.�.��)�)�&�1�1�H��{�f�$�$��'�'��/�/�/��!�(�(��0�0�0��-�;��2�2�6�:�:�:���%�%�f�-�-�-�-�
�^�	,��)�)�&�1�1�H��#�#�F�+�+�+��%�%�f�-�-�-��;�*�$�$��)�)�&�1�1�H��*�*�6�2�2�2�'-�'=�
@�
@�#��)��%�%�h��I���?�?�?�?��M�M�&�!�!�!� ���d�;�;�J����d�;�;�I��������#�0�������L��
7��!�(�(��6�6�6�6�6�/%�$�,
7�
7r"c��|jdks|j|jkr6|�|��}|xjt	|dd��z
c_dSdS)z�Accumulate total duration for nodeid from given report and update
        the Junit.testcase with the new total if already created.rrKrGN)r#r�r�rKr�r;s   r rMzLogXML.update_testcase_durationosc����7�*�*�f�k�T�=Q�.Q�.Q��)�)�&�1�1�H�������S�!A�!A�A�����/R�.Qr"c��|jsJ|�|��}|jr|�|��dS|�|��dSdSr))r�r<rKr�r�r;s   r �pytest_collectreportzLogXML.pytest_collectreportvsg���}�	8��)�)�&�1�1�H��}�
8��-�-�f�5�5�5�5�5��/�/��7�7�7�7�7�	8�	8r"�excreprc��|�d��}|j�dd���|�ddt	|����dS)N�internalr)r9r:r�zinternal error)r�rMr/rr#)rNrVr7s   r �pytest_internalerrorzLogXML.pytest_internalerror~sU���%�%�j�1�1�������z��B�B�B����W�&6��G���E�E�E�E�Er"c�6�tj��|_dSr))rrw�suite_start_time)rNs r �pytest_sessionstartzLogXML.pytest_sessionstart�s�� &��
�
����r"c
��tj�tj�|j����}tj|d���t
|jdd���5}tj��}||j	z
}|j
d|j
dz|j
dz|j
d	z|jz
}|�d
��tjd|jt!|j
d	��t!|j
d��t!|j
d��t!|��d|zt#j|j	�����t)j���
�	�	}|���}|�|�|��|jD])}|�|������*tjd��}	|	�|��|�tj|	d�����ddd��dS#1swxYwYdS)NT)�exist_ok�wzutf-8)�encodingr�r�r�r�z&<?xml version="1.0" encoding="utf-8"?>�	testsuiterv)r:�errors�failuresr��testsrw�	timestamp�hostname�
testsuites�unicode)r%r��dirnamer)r*�makedirs�openrrwr[r-r2�writer^r_r"r#r�
fromtimestamp�	isoformat�platformrP�_get_global_properties_noderSr/ry�tostring)
rNrir*�suite_stop_time�suite_time_delta�numtests�
suite_noder0r�rgs
          r �pytest_sessionfinishzLogXML.pytest_sessionfinish�st���'�/�/�"�'�/�/�$�,�"?�"?�@�@��
��G�d�+�+�+�+�
�$�,��g�
6�
6�
6�	G�'�$�k�m�m�O�.��1F�F���
�8�$��*�Y�'�(��*�Y�'�(��*�W�%�&��,�	-�
�
�M�M�B�C�C�C�����_��4�:�g�.�/�/��T�Z�	�2�3�3��D�J�y�1�2�2��(�m�m��.�.�"�0��1F�G�G�Q�Q�S�S�!����
�
�
�J�!%� @� @� B� B�� �,��!�!�"3�4�4�4�!%�!<�
:�
:�
��!�!�-�"6�"6�"8�"8�9�9�9�9���L�1�1�J����j�)�)�)��M�M�"�+�j�9�E�E�E�F�F�F�?	G�	G�	G�	G�	G�	G�	G�	G�	G�	G�	G�	G����	G�	G�	G�	G�	G�	Gs�/GI�I�I�terminalreporterc�B�|�dd|j����dS)Nr�zgenerated xml file: )�	write_sepr*)rNrws  r �pytest_terminal_summaryzLogXML.pytest_terminal_summary�s)���"�"�3�(M�t�|�(M�(M�N�N�N�N�Nr"r:rTc�|�d}td|��|j�|t|��f��dS)NTr:)r�r0rSr')rNr:rTr�s    r r�zLogXML.add_global_property�sB�� �� ���.�.�.���%�%�t�^�E�-B�-B�&C�D�D�D�D�Dr"c��|jrMtjd��}|jD]/\}}|�tjd||������0|SdSr[)r0r^r_rSr`s    r rpz"LogXML._get_global_properties_node�sg���!�	���L�1�1�J�#�5�
R�
R���e��!�!�"�*�Z�d�%�"P�"P�"P�Q�Q�Q�Q����tr")rr�rr@Tr�)r�r�r�rr#rrOrr�r
rCr�rIr<rRrMrUr
rYr\rvrrzr�r�r^r_rpr�r"r rr�sS������
#��&��"&�!#�!#���
�!#��	!#�
�!#��
!#� �!#�
�!#�!#�!#�!#�F �z� �d� � � � ��E�*�c�/�$:��}�����$!�S�!�T�!�!�!�!��J��=�����
V7�z�V7�d�V7�V7�V7�V7�pB�z�B�d�B�B�B�B�8�:�8�$�8�8�8�8�F�M�F�d�F�F�F�F�
.�.�.�.�$G�$G�$G�$G�LO�8H�O�T�O�O�O�O�E��E�F�E�t�E�E�E�E�
�X�b�j�-A������r"r�)9�__doc__r	r%ror$�xml.etree.ElementTree�etree�ElementTreer^r�typingrrrrrr	r
r�_pytestrr�_pytest._code.coder
r�_pytest.configrr�_pytest.config.argparsingr�_pytest.fixturesr�_pytest.reportsr�
_pytest.stashr�_pytest.terminalrr�r�r#r'r7rn�copyrCr��fixturer�r�r�r�rrrrgrr�r"r �<module>r�s���������	�	�	�	�����	�	�	�	�"�"�"�"�"�"�"�"�"�������������������������������������������������
�
�
�
�������������,�,�,�,�,�,�/�/�/�/�/�/�!�!�!�!�!�!�'�'�'�'�'�'�,�,�,�,�,�,�+�+�+�+�+�+�&�&�&�&�&�&�"�"�"�"�"�"�-�-�-�-�-�-��(�8�
�
�
��2��2�3�2�2�2�2�6�������+�v�!6�7����&�(?�(?�(?�@�����g�&�+�+�-�-������X�h�
��.�!9�:�:�:��g�&����l#�l#�l#�l#�l#�l#�l#�l#�^
�
�
�+.�
�	�
�
�
�
�"���^���#�v���9L�0M�������,���.��X�s�F�m�T�>Q�5R�������8E�C�E�C�E�D�E�E�E�E����i� � � �$�~�$�(�C��=�RV�CV�:W�$�$�$�!� �$�N,�V�,��,�,�,�,�^=�V�=��=�=�=�=�"-�v�-�$�-�-�-�-�����c������k�k�k�k�k�k�k�k�k�kr"