GhostManSec
Server: Apache
System: Linux s323.xrea.com 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: moonarc (17751)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/lib/python2.7/site-packages/_pytest/junitxml.pyo
�
��abc@`s0dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZe	jddkr�ddlmZneZeZeZdejjfd	��YZd$Zd%d&d'd(fZgeD]=\ZZee	j kr	ed�ee�ee�f^q	Z!geD]Z"ee"�^qSe!Z!ej#ed�ed�j$e!��Z%[[[!ej#d�Z&d�Z'de(fd��YZ)ej*d��Z+ej*d��Z,d�Z-d�Z.d �Z/d!�Z0d"e(fd#��YZ1dS()s'
    report 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
i(tabsolute_importtdivisiontprint_functionN(tnodes(tfilename_argi(topentJunitcB`seZRS((t__name__t
__module__(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyR si	i
i
i i~i�i��i�i��ii��s%s-%ss[^%s]ts\.py$cC`s1d�}tjjtj|tjj|���S(NcS`s>t|j��}|dkr,td�|Std�|SdS(Ni�s#x%02Xs#x%04X(tordtgrouptunicode(tmatchobjti((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytrepl;s(tpytxmltrawtillegal_xml_retsubtescape(targR((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytbin_xml_escape:s	t
_NodeReportercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�ZRS(cC`sR||_||_|jj|_d|_g|_g|_d|_i|_dS(Ni(	tidRt	add_statstdurationt
propertiesRtNonettestcasetattrs(tselftnodeidR((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyt__init__Fs						cC`s-|jjt|�j�|jj|�dS(N(RRttypeRRtappend(R tnode((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyR$QscC`s&|jjt|�t|�f�dS(N(RR$tstrR(R tnametvalue((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytadd_propertyUscC`st|�|jt|�<dS(N(RRR&(R R'R(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyt
add_attributeXscC`sH|jrDtjg|jD]$\}}tjd|d|�^q�SdS(sBReturn a Junit node containing custom properties, if any.
        R'R(R	(RRtproperty(R R'R(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytmake_properties_node[s
	2cC`s�t|j�}|j}|d }|jjrG|jd|jj�nidj|�d6t|d�d6|jdd6}|jddk	r�|jd|d<nt
|d	�r�|j|d	<n||_|jj|�dS(
Ni����it.t	classnameR'tfileitlineturl(
tmangle_test_addressR!RRtprefixtinserttjoinRtlocationRthasattrR1tupdate(R t
testreporttnamestexisting_attrst
classnamesR((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytrecord_testreportes	
	cC`sStjd|j|j�}|j|j��x|jD]}|j|�q8W|S(Nttime(RRRRR$R,R(R RR%((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytto_xmlxs
cC`s/t|�}||d|�}|j|�dS(Ntmessage(RR$(R tkindR@tdataR%((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyt_add_simplescC`s]xVdD]N}t|d|�}|rttd|�}|j|t|���qqWdS(Ntoutterrtcapstdssystem-(RDRE(tgetattrRR$R(R treporttcapnametcontentttag((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytwrite_captured_output�s

cC`s|jd�dS(Ntpassed(R(R RH((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytappend_pass�scC`s�t|d�r%|jtjd�n�t|jd�rI|jjj}n3t|jtt	f�rm|j}nt	|j�}t
|�}tjd|�}|jt
|j��|j|�dS(Ntwasxfails%xfail-marked test passes unexpectedlyt	reprcrashR@(
R7RCRtskippedtlongreprRPR@t
isinstanceRR&RtfailureR$(R RHR@tfail((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytappend_failure�s
cC`s)|jtjt|j�dd��dS(NR@scollection failure(R$RterrorRRR(R RH((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytappend_collect_error�scC`s|jtjd|j�dS(Nscollection skipped(RCRRQRR(R RH((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytappend_collect_skipped�scC`sDt|dd�dkr!d}nd}|jtj||j�dS(Ntwhentteardownstest teardown failurestest setup failure(RGRRCRRWRR(R RHtmsg((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytappend_error�s
	cC`s�t|d�r+|jtjd|j�nc|j\}}}|jd�r_t|d�}n|jtjd|||fddd|��|j	|�dS(	NROsexpected test failures	Skipped: i	s	%s:%s: %sR#spytest.skipR@(
R7RCRRQRORRt
startswithRR$RL(R RHtfilenametlinenot
skipreason((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytappend_skipped�s
c`s;|j�jdd��|jj��fd�|_dS(Ntindentic`stjj��S(N(RRR((RB(s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyt<lambda>�R	(R?Rt__dict__tclear(R ((RBs4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytfinalize�s
N(RRR"R$R)R*R,R=R?RRCRLRNRVRXRYR]RbRg(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyREs 					
									cC`sg|jjdddd�t|jdd�}|dk	rV|j|jj�}|jSd�}|SdS(s�Add extra xml properties to the tag for the calling test.
    The fixture is callable with ``(name, value)``, with value being automatically
    xml-encoded.
    tcodetC3R@s.record_xml_property is an experimental featuret_xmlcS`sdS(N((R'R(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytadd_property_noop�sN(R%twarnRGtconfigRt
node_reporterR!R)(trequestRRnRk((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytrecord_xml_property�s	cC`sg|jjdddd�t|jdd�}|dk	rV|j|jj�}|jSd�}|SdS(s�Add extra xml attributes to the tag for the calling test.
    The fixture is callable with ``(name, value)``, with value being automatically
    xml-encoded
    RhRiR@s/record_xml_attribute is an experimental featureRjcS`sdS(N((R'R(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyt
add_attr_noop�sN(R%RlRGRmRRnR!R*(RoRRnRq((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytrecord_xml_attribute�s	cC`s�|jd�}|jdddddddd	d
tjtdd�ddd
d�|jddddddddd
d�|jdddd�dS(Nsterminal reportings
--junitxmls--junit-xmltactiontstoretdesttxmlpathtmetavartpathR#toptnametdefaultthelps1create junit-xml style report file at given path.s
--junitprefixs--junit-prefixR&s0prepend prefix to classnames in junit-xml outputtjunit_suite_names Test suite name for JUnit reporttpytest(tgetgroupt	addoptiont	functoolstpartialRRtaddini(tparserR((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_addoption�s 		cC`s`|jj}|r\t|d�r\t||jj|jd��|_|jj|j�ndS(Nt
slaveinputR|(	toptionRvR7tLogXMLtjunitprefixtgetiniRjt
pluginmanagertregister(RmRv((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_configures$cC`s5t|dd�}|r1|`|jj|�ndS(NRj(RGRRjR�t
unregister(RmR((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_unconfigurescC`s�|jd�\}}}|jd�}y|jd�Wntk
rKnX|djtjd�|d<tjd|d�|d<|dc||7<|S(Nt[s::s()iR-R	i����(	t	partitiontsplittremovet
ValueErrortreplaceRtSEPt
_py_ext_reR(taddressRxtpossible_open_brackettparamsR:((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyR2s
R�cB`s�eZdd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�ZRS(R}cC`s�tjjtjj|��}tjjtjj|��|_||_||_t	j
ddddgd�|_i|_g|_
g|_g|_d|_dS(NRWRMRTRQi(tosRxt
expandusert
expandvarstnormpathtabspathtlogfileR3t
suite_nametdicttfromkeyststatstnode_reporterstnode_reporters_orderedtglobal_propertiestopen_reportstcnt_double_fail_tests(R R�R3R�((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyR""s!						cC`sYt|d|�}t|dd�}|jj||f�}|dk	rU|j�ndS(NR!R%(RGRR�tpopRg(R RHR!t	slavenodetreporter((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyRg4s
cC`szt|d|�}t|dd�}||f}||jkrJ|j|St||�}||j|<|jj|�|S(NR!R%(RGRR�RR�R$(R RHR!R�tkeyR�((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyRn<s
cC`s)||jkr%|j|cd7<ndS(Ni(R�(R R�((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyRNscC`s |j|�}|j|�|S(N(RnR=(R RHR�((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyt
_opentestcaseRs
c`s�d}�jr@�jdkrB|j��}|j��qBn�jr�jdkr�t�dd��t�dd��t���fd�|jD�d�}|r�|j	|�|j
d7_
q�n|j��}�jdkr
|j��|jj��qB|j
��n(�jrB|j��}|j��n|j���jdkr�|j��}|j��|j	��t�dd��t�dd��t���fd�|jD�d�}|r�|jj|�q�ndS(	shandle 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
        tcallR[t	worker_idt
item_indexc3`sW|]M}|j�jkrt|dd��krt|dd��kr|VqdS(R�R�N(R!RGR(t.0trep(RHt	report_iit
report_wid(s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pys	<genexpr>ysic3`sW|]M}|j�jkrt|dd��krt|dd��kr|VqdS(R�R�N(R!RGR(R�R�(RHR�R�(s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pys	<genexpr>�sN(RRMRZR�RNtfailedRGtnextR�RgR�RVR$R]RQRbtupdate_testcase_durationRLR�(R RHtclose_reportR�((RHR�R�s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_runtest_logreportWsF			

	


	cC`s.|j|�}|jt|dd�7_dS(s�accumulates total duration for nodeid from given report and updates
        the Junit.testcase with the new total if already created.
        RgN(RnRRG(R RHR�((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyR��scC`sE|jsA|j|�}|jr1|j|�qA|j|�ndS(N(RMR�R�RXRY(R RHR�((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_collectreport�s
		cC`sB|jd�}|jjdddd�|jtjd|�dS(NtinternalR.R}R'sinternal error(RnRR8RCRRW(R texcreprR�((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_internalerror�scC`stj�|_dS(N(R>tsuite_start_time(R ((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_sessionstart�scC`sKtjjtjj|j��}tjj|�sCtj|�nt|jddd�}tj�}||j	}|j
d|j
d|j
d|j
d|j}|jd�|jt
j|j�g|jD]}|j�^q�d	|jd
|j
dd|j
dd|j
dd
|dd|�jdd��|j�dS(Ntwtencodingsutf-8RMRTRQRWs&<?xml version="1.0" encoding="utf-8"?>R'terrorstfailurestskipsttestsR>s%.3fRci(R�RxtdirnameR�R�tisdirtmakedirsRR>R�R�R�twriteRt	testsuitet_get_global_properties_nodeR�R?R�Rtclose(R R�R�tsuite_stop_timetsuite_time_deltatnumteststx((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_sessionfinish�s&!
+

	"	


cC`s|jdd|j�dS(Nt-sgenerated xml file: %s(t	write_sepR�(R tterminalreporter((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytpytest_terminal_summary�s	cC`s&|jjt|�t|�f�dS(N(R�R$R&R(R R'R(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pytadd_global_property�scC`sH|jrDtjg|jD]$\}}tjd|d|�^q�SdS(sBReturn a Junit node containing custom properties, if any.
        R'R(R	(R�RRR+(R R'R(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyR��s
	2(RRR"RgRnRR�R�R�R�R�R�R�R�R�R�(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyR�!s					H							(i	i
i
(i i~(i�i��(i�i��(ii��(2t__doc__t
__future__RRRR�RR�tretsysR>R}t_pytestRt_pytest.configRtversion_infotcodecsRtchrtunichrR&RtinttlongRt	NamespaceRt_legal_charst
_legal_rangestlowthight
maxunicodet
_legal_xml_reR�tcompileR5RR�RtobjectRtfixtureRpRrR�R�R�R2R�(((s4/usr/lib/python2.7/site-packages/_pytest/junitxml.pyt<module>
sF	G#(	�