+
    yjc                       R t ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RI	Ht ^ RIHu Ht ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH t  ^ RI!H"t" ^ RI#t#] R,          ! 4       t$R R lt%R R lt&/ t'RRR./]'R&   R. R5O/]'R&   ]'R,          PQ                  4       ]'R&   ]&! ]'R,          ]'R,          4       ]'R,          ]'R&    ! R R4      t)R  R! lt*]#PV                  R" R# l4       t,]#PV                  R$ R% l4       t-R& R' lt.]#PV                  ! R(R)7      R* R+ l4       t/R, R- lt0R. R/ lt1R0 R1 lt2R2 R3 lt3 ! R4 R4      t4R# )6a  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
)annotations)datetime)timezoneN)Callable)Match)nodes)timing)ExceptionRepr)ReprFileLocation)Config)filename_arg)Parser)FixtureRequest)
TestReport)StashKey)TerminalReporterLogXMLc                    V ^8  d   QhRRRR/# )   argobjectreturnstr )formats   "D/var/www/html/2rare/lib/python3.14/site-packages/_pytest/junitxml.py__annotate__r   (   s     2 2 23 2    c                R    R R lpRp\         P                  ! W!\        V 4      4      # )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.
c                    V ^8  d   QhRRRR/# )r   matchobjz
Match[str]r   r   r   )r   s   "r   r   $bin_xml_escape.<locals>.__annotate__3   s        z  c  r   c                Z    \        V P                  4       4      pV^8:  d   RVR 2# RVR 2# )   z#x02X04X)ordgroup)r    is   & r   replbin_xml_escape.<locals>.repl3   s6     !9#w<#w<r   u    [^	
 -~-퟿-�က0-ჿff])resubr   )r   r)   illegal_xml_res   &  r   bin_xml_escaper.   (   s)      	W  66.C11r   c                   V ^8  d   QhRR/# r   r   Noner   )r   s   "r   r   r   C   s       r   c                    / pV P                  4        FR  w  r4VP                  4        F9  w  rV\        V\        4      '       g   \        \	        V4      4      hWF,           W#&   K;  	  KT  	  V P                  V4       R # N)items
isinstancelist	TypeErrortypeupdate)leftrightresultklvlkrvrs   &&     r   merge_familyrA   C   s^    F**,kkmFBb$''R))FJ $ 
 	KKr   testcase	classnamename_base_base_legacyxunit1xunit2c                      ] tR t^YtR R ltR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R'R R lltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# ltR$ R% ltR&tR# )(_NodeReporterc               $    V ^8  d   QhRRRRRR/# )r   nodeidzstr | TestReportxmlr   r   r1   r   )r   s   "r   r   _NodeReporter.__annotate__Z   s"     ( (/ (f ( (r   c                	    Wn         W n        V P                  P                  V n        V P                  P                  V n        R V n        . V n        . V n        / V n        R# )        N)idrM   	add_statsfamilyduration
propertiesr   attrs)selfrL   rM   s   &&&r   __init___NodeReporter.__init__Z   sH    ++hhoo13')
%'
r   c                    V ^8  d   QhRRRR/# )r   node
ET.Elementr   r1   r   )r   s   "r   r   rN   d   s        :  $  r   c                	    V P                   P                  VP                  4       V P                  P	                  V4       R # r3   )rM   rR   tagr   append)rW   r[   s   &&r   r_   _NodeReporter.appendd   s*    488$

$r   c               $    V ^8  d   QhRRRRRR/# r   rD   r   valuer   r   r1   r   )r   s   "r   r   rN   h   s&     C C CV C Cr   c                	d    V P                   P                  \        V4      \        V4      34       R # r3   )rU   r_   r   r.   rW   rD   rc   s   &&&r   add_property_NodeReporter.add_propertyh   s"    D	>%+@ABr   c               $    V ^8  d   QhRRRRRR/# rb   r   )r   s   "r   r   rN   k   s!     6 6# 6f 6 6r   c                	H    \        V4      V P                  \        V4      &   R # r3   )r.   rV   r   re   s   &&&r   add_attribute_NodeReporter.add_attributek   s     .u 5

3t9r   c                   V ^8  d   QhRR/# r   r   zET.Element | Noner   )r   s   "r   r   rN   n   s      &7 r   c           	         V P                   '       dU   \        P                  ! R4      pV P                    F,  w  r#VP                  \        P                  ! RW#R7      4       K.  	  V# R# z9Return a Junit node containing custom properties, if any.rU   propertyrD   rc   N)rU   ETElementr_   rW   rU   rD   rc   s   &   r   make_properties_node"_NodeReporter.make_properties_noden   sK    ???L1J#!!"**Zd"PQ  /r   c                    V ^8  d   QhRRRR/# )r   
testreportr   r   r1   r   )r   s   "r   r   rN   w   s        J  4  r   c                	   \        VP                  4      pV P                  pVR R	 pV P                  P                  '       d'   VP                  ^ V P                  P                  4       RRP                  V4      R\        VR	,          4      RVP                  ^ ,          /pVP                  ^,          e    \        VP                  ^,          4      VR&   \        VR4      '       d   VP                  VR&   WPn        V P                  P                  V4       V P                  R8X  d   R # / pV P                   F=  pV\        V P                  ,          R,          9   g   K(  V P                  V,          Wg&   K?  	  W`n        R # )
NrC   .rD   filelineurlrG   rB   )mangle_test_addressrL   rV   rM   prefixinsertjoinr.   locationr   hasattrr}   r9   rS   families)rW   rx   namesexisting_attrs
classnamesrV   
temp_attrskeys   &&      r   record_testreport_NodeReporter.record_testreportw   s-   #J$5$563BZ
88???a1*-N59-J''*!

 q!-
 3 3A 67E&M:u%%%>>E%L


.) ;;(" 
::Cht{{+J77"&**S/
   
r   c                   V ^8  d   QhRR/# )r   r   r\   r   )r   s   "r   r   rN      s      
 r   c                	    \         P                  ! R V P                  V P                  R R7      pV P	                  4       pVe   VP                  V4       VP                  V P                  4       V# )rB   .3f)time)rr   rs   rV   rT   ru   r_   extendr   )rW   rB   rU   s   &  r   to_xml_NodeReporter.to_xml   sV    ::j$**dmmC=PR..0
!OOJ'

#r   Nc               (    V ^8  d   QhRRRRRRRR/# )r   r^   r   messagedata
str | Noner   r1   r   )r   s   "r   r   rN      s(      s S 
 d r   c                	v    \         P                  ! WR 7      p\        V4      Vn        V P	                  V4       R# ))r   Nrr   rs   r.   textr_   )rW   r^   r   r   r[   s   &&&& r   _add_simple_NodeReporter._add_simple   s(    zz#/"4(	Dr   c                    V ^8  d   QhRRRR/# r   reportr   r   r1   r   )r   s   "r   r   rN      s     C CJ C4 Cr   c                	   V P                   P                  '       g   VP                  '       d   R # VP                  pVP                  pVP
                  pV P                   P                  R8X  d   R # RpV P                   P                  R9   d   V P                  VR4      pV P                   P                  R	9   d-   WPP                  VR4      ,          pV P                  WR4       RpV P                   P                  R
9   d-   WPP                  VR4      ,          pV P                  WR4       RpV'       d   V P                  WR4       R # R # )Nno z Captured Log 
system-outz Captured Out 
system-errz Captured Err )logall)r   out-errr   )r   r   r   )	rM   log_passing_testspassed	capstdoutcaplog	capstderrlogging_prepare_content_write_content)rW   r   content_outcontent_logcontent_errcontent_alls   &&    r   write_captured_output#_NodeReporter.write_captured_output   s   xx)))fmmm&&mm&&88t#88~-//=MNK88??00>NOOK\BK88??00>NOOK\BK\B r   c               $    V ^8  d   QhRRRRRR/# )r   contentr   headerr   r   )r   s   "r   r   rN      s&     @ @ @S @S @r   c                	J    R P                  VP                  ^PR4      VR.4      # )
-r   )r   center)rW   r   r   s   &&&r   r   _NodeReporter._prepare_content   s#    yy&--C0'2>??r   c               (    V ^8  d   QhRRRRRRRR/# )r   r   r   r   r   jheaderr   r1   r   )r   s   "r   r   rN      s)      Z #  PT r   c                	t    \         P                  ! V4      p\        V4      Vn        V P	                  V4       R # r3   r   )rW   r   r   r   r^   s   &&&& r   r   _NodeReporter._write_content   s(    jj!!'*Cr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   rN      s     ! !* ! !r   c                	(    V P                  R 4       R# )r   N)rR   rW   r   s   &&r   append_pass_NodeReporter.append_pass   s    x r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   rN      s     G GZ GD Gr   c                	N   \        VR 4      '       d   V P                  RR4       R# VP                  f   Q h\        VP                  RR4      pVe   VP                  pM\        VP                  4      p\        V4      pV P                  RV\        VP                  4      4       R# )wasxfailskippedz%xfail-marked test passes unexpectedlyN	reprcrashfailure)r   r   longreprgetattrr   r   r.   )rW   r   r   r   s   &&  r   append_failure_NodeReporter.append_failure   s    6:&&Y(OP??...18d2I $#++foo.$W-GYV__1EFr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   rN      s     N N: N$ Nr   c                	r    VP                   f   Q hV P                  RR\        VP                   4      4       R # )Nerrorzcollection failure)r   r   r   r   s   &&r   append_collect_error"_NodeReporter.append_collect_error   s.    ***"6FOO8LMr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   rN      s     P PZ PD Pr   c                	R    V P                  R R\        VP                  4      4       R# )r   zcollection skippedN)r   r   r   r   s   &&r   append_collect_skipped$_NodeReporter.append_collect_skipped   s    $8#foo:NOr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   rN      s     M M: M$ Mr   c                	:   VP                   f   Q h\        VP                   RR 4      pVe   VP                  pM\        VP                   4      pVP                  R8X  d   RV R2pMRV R2pV P                  R\        V4      \        VP                   4      4       R # )Nr   teardownzfailed on teardown with ""zfailed on setup with "r   )r   r   r   r   whenr   r.   )rW   r   r   reasonmsgs   &&   r   append_error_NodeReporter.append_error   s    ***-4V__kSW-X	 &&F)F;;*$-fXQ7C*6(!4C."5s6??7KLr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   rN      s     / /Z /D /r   c                	N   \        VR 4      '       dd   VP                  pVP                  R4      '       d
   VR,          p\        V4      p\        P
                  ! RRVR7      pV P                  V4       R# \        VP                  \        4      '       g   Q hVP                  w  rEpVP                  R4      '       d
   VR,          pV RV R	V 2p\        P
                  ! RR
\        V4      R7      p\        V4      Vn
        V P                  V4       V P                  V4       R# )r   zreason: :   NNr   zpytest.xfail)r8   r   z	Skipped: :	   NN:z: zpytest.skipN)r   r   
startswithr.   rr   rs   r_   r5   r   tupler   r   )rW   r   xfailreasonr   filenamelineno
skipreasondetailss   &&      r   append_skipped_NodeReporter.append_skipped   s    6:&& //K%%j11)"o(5KjjUGKK foou5555+1??(Hj$$[11'^
!
!F82j\:Gjj~j7QG *'2GLKK &&v.r   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   rN      s     # #$ #r   c                	r   a V P                  4       oV P                  P                  4        V3R  lV n         R# )c                    < S # r3   r   )r   s   r   <lambda>(_NodeReporter.finalize.<locals>.<lambda>  s    dr   N)r   __dict__clear)rW   r   s   &@r   finalize_NodeReporter.finalize   s'    {{} #r   )	rR   rV   rT   rS   rQ   r   rU   r   rM   r3   )__name__
__module____qualname____firstlineno__rX   r_   rf   rj   ru   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r   r   r   rJ   rJ   Y   sh    ( C6 <
C.@
!G N
PM/,# #r   rJ   c               $    V ^8  d   QhRRRRRR/# )r   requestr   fixture_namer   r   r1   r   )r   s   "r   r   r     s$     
 

+.
	
r   c                    ^ RI Hp V P                  P                  P	                  \
        R4      pVeG   VP                  R9  d4   V P                  P                  V! V RVP                   R24      4       R# R# R# )z[Emit a PytestWarning about the given fixture being incompatible with newer xunit revisions.)PytestWarningNz$ is incompatible with junit_family 'z' (use 'legacy' or 'xunit1'))rG   legacy)	_pytest.warning_typesr  configstashgetxml_keyrS   r[   warn)r   r  r  rM   s   &&  r   !_warn_incompatibility_with_xunit2r    sl     4
..


"
"7D
1C
3::-AA. DSZZLPlm	
 Br   c                    V ^8  d   QhRRRR/# r   r   r   r   zCallable[[str, object], None]r   )r   s   "r   r   r     s      ^ 0M r   c                2   a  \        S R4       R V 3R llpV# )aN  Add 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_propertyc               $    V ^8  d   QhRRRRRR/# rb   r   )r   s   "r   r   %record_property.<locals>.__annotate__(  s!     ; ;c ;& ;T ;r   c                T   < SP                   P                  P                  W34       R # r3   )r[   user_propertiesr_   )rD   rc   r   s   &&r   append_property(record_property.<locals>.append_property(  s    $$++TM:r   )r  )r   r  s   f r   r  r    s"     &g/@A; ; r   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r   /  s      . 5R r   c                :   ^ RI Hp V P                  P                  V! R4      4       \	        V R4       R R lpTpV P
                  P                  P                  \        R4      pVe2   VP                  V P                  P                  4      pVP                  pV# )zAdd extra xml attributes to the tag for the calling test.

The fixture is callable with ``name, value``. The value is
automatically XML-encoded.
)PytestExperimentalApiWarningz/record_xml_attribute is an experimental featurerecord_xml_attributec               $    V ^8  d   QhRRRRRR/# rb   r   )r   s   "r   r   *record_xml_attribute.<locals>.__annotate__>  s!      C  4 r   c                    R # r3   r   rq   s   &&r   add_attr_noop+record_xml_attribute.<locals>.add_attr_noop>  s    r   N)r  r  r[   r
  r  r  r  r  r	  node_reporterrL   rj   )r   r  r  	attr_funcrM   r  s   &     r   r  r  .  s     CLL$%VW &g/EF I
..


"
"7D
1C
))',,*=*=>!//	r   c               $    V ^8  d   QhRRRRRR/# )r   paramr   vr   r1   r   )r   s   "r   r   r   K  s&     E EC EC ED Er   c                    Rp\        V\        4      '       g2   Rp\        VP                  V \	        V4      P
                  R7      4      hR# )z_Used 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)r5   r   r7   r   r8   r   )r"  r#  __tracebackhide__r   s   &&  r   _check_record_param_typer'  K  sC     aE

$q'2B2B
CDD r   session)scopec                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r   U  s     # #~ #:W #r   c                    RpR R lpV P                   P                  P                  \        R4      pVe   VP                  pV# )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.
Tc               $    V ^8  d   QhRRRRRR/# rb   r   )r   s   "r   r   /record_testsuite_property.<locals>.__annotate__p  s!     / /# /f / /r   c                "    Rp\        RV 4       R# )zFNo-op function in case --junit-xml was not passed in the command-line.TrD   N)r'  )rD   rc   r&  s   && r   record_func.record_testsuite_property.<locals>.record_funcp  s      .r   N)r  r  r  r	  add_global_property)r   r&  r/  rM   s   &   r   record_testsuite_propertyr2  T  sC    4 /
 ..


"
"7D
1C
--r   c                    V ^8  d   QhRRRR/# )r   parserr   r   r1   r   )r   s   "r   r   r   {  s     , ,V , ,r   c                   V P                  R 4      pVP                  RRRRR\        P                  ! \        RR7      RRR	7       VP                  R
RRRRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRRR7       V P                  RRRR7       V P                  RRR R7       R# )!zterminal reportingz
--junitxmlz--junit-xmlstorexmlpathpath)optnameNz0Create junit-xml style report file at given path)actiondestmetavarr8   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)r8   r=  junit_duration_reportz*Duration time to report: one of total|calltotaljunit_familyz0Emit XML for schema: one of legacy|xunit1|xunit2rH   )getgroup	addoption	functoolspartialr   addini)r4  r'   s   & r   pytest_addoptionrL  {  s    OO01E	OO|\B?  	 
OO?   MM>   MM	:	   MM!E	   MM4  
 MM:  r   c                    V ^8  d   QhRRRR/# r   r  r   r   r1   r   )r   s   "r   r   r     s     = =V = =r   c                   V P                   P                  pV'       d   \        V R 4      '       g   V P                  R4      p\	        VV P                   P
                  V P                  R4      V P                  R4      V P                  R4      VV P                  R4      4      V P                  \        &   V P                  P                  V P                  \        ,          4       R# R# R# )workerinputrF  r?  rA  rD  rB  N)
optionr7  r   getinir   junitprefixr  r	  pluginmanagerregister)r  r7  rF  s   &  r   pytest_configurerV    s    mm##Gwv}55}}^4 &MM%%MM,-MM/*MM12MM34!
W 	%%fll7&;< 6wr   c                    V ^8  d   QhRRRR/# rN  r   )r   s   "r   r   r     s     - -v -$ -r   c                    V P                   P                  \        R 4      pV'       d/   V P                   \         V P                  P	                  V4       R # R # r3   )r  r  r	  rT  
unregister)r  rM   s   & r   pytest_unconfigurerZ    s@    
,,

7D
)C
LL!'', r   c                    V ^8  d   QhRRRR/# )r   addressr   r   z	list[str]r   )r   s   "r   r   r     s        r   c                   V P                  R 4      w  rpVP                  R4      pV^ ,          P                  \        P                  R4      V^ &   \
        P                  ! RRV^ ,          4      V^ &   VR;;,          W#,           ,          uu&   V# )[z::rz   z\.py$r   r~   )	partitionsplitreplacer   SEPr+   r,   )r\  r8  possible_open_bracketparamsr   s   &    r   r   r     st    *1*;*;C*@'DJJtEQx		3/E!HvvhE!H-E!H	"I&//ILr   c                      ] tR tRtR R R lltR R ltR R ltR R	 ltR
 R ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltRtR# )!r   i  c               0    V ^8  d   QhRRRRRRRRRRR	R
/# )r   r   r   
suite_namer   r   report_durationr   rC  r   r1   r   )r   s   "r   r   LogXML.__annotate__  sH     # # # 	#
 # #  # 
#r   c                	   \         P                  P                  \         P                  P                  V4      4      p\         P                  P	                  \         P                  P                  V4      4      V n        W n        W0n        W@n	        Wpn
        WPn        W`n        \        P                  . RO^ 4      V n        / V n        . V n        . V n        . V n        ^ V n        V P                  R8X  d
   RV n        R# R# )r   r  rG   N)r   r   r   r   )osr8  
expanduser
expandvarsnormpathabspathlogfiler   rg  r   r   rh  rS   dictfromkeysstatsnode_reportersnode_reporters_orderedglobal_propertiesopen_reportscnt_double_fail_tests)rW   rp  r   rg  r   rh  rS   r   s   &&&&&&&&r   rX   LogXML.__init__  s     ''$$RWW%7%7%@Aww''(@A$!2.%)]]5q&

 UW;=#8: /1%&" ;;(""DK #r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   ri    s     
  
 z 
 d 
 r   c                	    \        VR V4      p\        VRR4      pV P                  P                  W#34      pVP                   F   w  rVVP	                  V\        V4      4       K"  	  Ve   VP                  4        R# R# rL   r[   N)r   rt  popr  rf   r   r   )rW   r   rL   
workernodereporterpropname	propvalues   &&     r   r   LogXML.finalize  sw    62VVT2
&&**F+?@#)#9#9H!!(C	N; $:   r   c                    V ^8  d   QhRRRR/# )r   r   zTestReport | strr   rJ   r   )r   s   "r   r   ri    s      $4  r   c                	    \        VR V4      p\        VRR4      pW#3pW@P                  9   d   V P                  V,          # \        W 4      pWPP                  V&   V P                  P	                  V4       V# r|  )r   rt  rJ   ru  r_   )rW   r   rL   r~  r   r  s   &&    r   r  LogXML.node_reporter  st    #*68V#DVVT2
 %%%&&s++ .#+C ##**84r   c                    V ^8  d   QhRRRR/# )r   r   r   r   r1   r   )r   s   "r   r   ri    s     ! !S !T !r   c                	h    WP                   9   d"   V P                   V;;,          ^,          uu&   R# R# )   N)rs  )rW   r   s   &&r   rR   LogXML.add_stats  s#    **JJsOq O r   c                    V ^8  d   QhRRRR/# )r   r   r   r   rJ   r   )r   s   "r   r   ri    s      J = r   c                	J    V P                  V4      pVP                  V4       V# r3   )r  r   rW   r   r  s   && r   _opentestcaseLogXML._opentestcase  s%    %%f-""6*r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   ri    s     S7 S7z S7d S7r   c                  aaa RpSP                   '       d6   SP                  R8X  d#   V P                  S4      pVP                  S4       EMJSP                  '       Ed   SP                  R8X  do   \        SRR4      o\        SRR4      o\        VVV3R lV P                   4       R4      pV'       d+   V P                  V4       V ;P                  ^,          un	        V P                  S4      pSP                  R8X  dQ   VP                  S4       V P                  P                  S4       V P                  '       g   VP                  S4       MFVP                  S4       M4SP                  '       d#   V P                  S4      pVP!                  S4       V P#                  S4       SP                  R8X  d   V P                  S4      pVP                  S4       V P                  S4       \        SRR4      o\        SRR4      o\        VVV3R lV P                   4       R4      pV'       d   V P                  P%                  V4       R# R# R# )a  Handle 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_indexc              3     <"   T FL  pVP                   SP                   8X  g   K   \        VR R4      S8X  g   K4  \        VRR4      S8X  g   KH  Vx  KN  	  R# 5ir  Nr  rL   r   .0repr   	report_ii
report_wids   & r   	<genexpr>2LogXML.pytest_runtest_logreport.<locals>.<genexpr>8  sZ      #4CJJ&--7  !(\4 @I M	 
 !([$ ?: M #4   AAA
Ac              3     <"   T FL  pVP                   SP                   8X  g   K   \        VR R4      S8X  g   K4  \        VRR4      S8X  g   KH  Vx  KN  	  R# 5ir  r  r  s   & r   r  r  ]  sZ      0

fmm3  $Ct<	I	 
 $Cd;zI C0r  )r   r   r  r   failedr   nextrw  r   rx  r   r_   r   r   r   r   r   update_testcase_durationremove)rW   r   close_reportr  r  r  s   &f  @@r   pytest_runtest_logreportLogXML.pytest_runtest_logreport  s   . ==={{f$--f5$$V,]]]{{j($V[$?
#FL$?	##'#4#4     MM,/..!3.))&1H{{f$''/!!((0---226:%%f-^^^))&1H##F+%%f-;;*$))&1H**62MM&! d;Jd;I#00 L !!((6 ' %r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   ri  k  s     B Bz Bd Br   c                    V P                   RVP                  09   d8   V P                  V4      pV;P                  \	        VRR4      ,          un        R# R# )z{Accumulate total duration for nodeid from given report and update
the Junit.testcase with the new total if already created.rE  rT   rP   N)rh  r   r  rT   r   r  s   && r   r  LogXML.update_testcase_durationk  sJ     GV[[#99))&1HS!AA :r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   ri  r  s     8 8: 8$ 8r   c                	    VP                   '       gJ   V P                  V4      pVP                  '       d   VP                  V4       R # VP	                  V4       R # R # r3   )r   r  r  r   r   r  s   && r   pytest_collectreportLogXML.pytest_collectreportr  sE    }}}))&1H}}}--f5//7 r   c                    V ^8  d   QhRRRR/# )r   excreprr	   r   r1   r   )r   s   "r   r   ri  z  s     F FM Fd Fr   c                	    V P                  R 4      pVP                  P                  RR R7       VP                  RR\	        V4      4       R# )internalr@  )rC   rD   r   zinternal errorN)r  rV   r9   r   r   )rW   r  r  s   && r   pytest_internalerrorLogXML.pytest_internalerrorz  s@    %%j1zBW&6GEr   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   ri    s     . .T .r   c                	:    \         P                  ! 4       V n        R # r3   )r   r   suite_start_time)rW   s   &r   pytest_sessionstartLogXML.pytest_sessionstart  s     &r   c                   V ^8  d   QhRR/# r0   r   )r   s   "r   r   ri    s     &G &Gd &Gr   c                	   \         P                  P                  \         P                  P                  V P                  4      4      p\         P
                  ! VR R7       \        V P                  RRR7      ;_uu_ 4       p\        P                  ! 4       pW0P                  ,
          pV P                  R,          V P                  R,          ,           V P                  R,          ,           V P                  R,          ,           V P                  ,
          pVP                  R	4       \        P                  ! R
V P                  \!        V P                  R,          4      \!        V P                  R,          4      \!        V P                  R,          4      \!        V4      VR \"        P$                  ! V P                  \&        P(                  4      P+                  4       P-                  4       \.        P0                  ! 4       R7	      pV P3                  4       pVe   VP5                  V4       V P6                   F"  pVP5                  VP9                  4       4       K$  	  \        P                  ! R4      p	V	P5                  V4       VP                  \        P:                  ! V	RR7      4       RRR4       R#   + '       g   i     R# ; i)T)exist_okwzutf-8)encodingr   r   r   r   z&<?xml version="1.0" encoding="utf-8"?>	testsuiter   )rD   errorsfailuresr   testsr   	timestamphostnameN
testsuitesunicode)rk  r8  dirnamero  rp  makedirsopenr   r   r  rs  rx  writerr   rs   rg  r   r   fromtimestampr   utc
astimezone	isoformatplatformr[   _get_global_properties_noder_   ru  r   tostring)
rW   r  rp  suite_stop_timesuite_time_deltanumtests
suite_noderv  r  r  s
   &         r   pytest_sessionfinishLogXML.pytest_sessionfinish  s   ''//"''//$,,"?@
Gd+$,,g66'$kkmO.1F1FF 

8$**Y'(**Y'( **W%& ,,	-  MMBC__4::g./TZZ	23DJJy12(m(-"001F1FU!J !% @ @ B ,!!"34!%!<!<!!-"6"6"89 "=L1Jj)MM"++j9EFC 7666s   ?H(J11K	c                    V ^8  d   QhRRRR/# )r   terminalreporterr   r   r1   r   )r   s   "r   r   ri    s     O O8H OT Or   c                	D    VP                  R RV P                   24       R# )r   zgenerated xml file: N)	write_seprp  )rW   r  s   &&r   pytest_terminal_summaryLogXML.pytest_terminal_summary  s    ""3*>t||n(MNr   c               $    V ^8  d   QhRRRRRR/# rb   r   )r   s   "r   r   ri    s&     E E EF Et Er   c                	n    R p\        RV4       V P                  P                  V\        V4      34       R# )TrD   N)r'  rv  r_   r.   )rW   rD   rc   r&  s   &&& r   r1  LogXML.add_global_property  s0      .%%t^E-B&CDr   c                   V ^8  d   QhRR/# rm   r   )r   s   "r   r   ri    s      -> r   c           	         V P                   '       dU   \        P                  ! R4      pV P                    F,  w  r#VP                  \        P                  ! RW#R7      4       K.  	  V# R# ro   )rv  rr   rs   r_   rt   s   &   r   r  "LogXML._get_global_properties_node  sP    !!!L1J#55!!"**Zd"PQ  6r   )rx  rS   rv  r   rp  r   rt  ru  rw  r   rh  rs  rg  r  N)r@  r   rE  rG   T)r   r   r   r   rX   r   r  rR   r  r  r  r  r  r  r  r  r1  r  r   r   r   r   r   r     sV    #B
 $!
S7jB8F
.&GPOE
 r   )r{   r|   r}   )5__doc__
__future__r   r   r   rI  rk  r  r+   typingr   r   xml.etree.ElementTreeetreeElementTreerr   _pytestr   r   _pytest._code.coder	   r
   _pytest.configr   r   _pytest.config.argparsingr   _pytest.fixturesr   _pytest.reportsr   _pytest.stashr   _pytest.terminalr   r@  r	  r.   rA   r   copyrJ   r  fixturer  r  r'  r2  rL  rV  rZ  r   r   r   r   r   <module>r     s[   #    	  	   " "   , / ! ' , + & " -  8

26 +v!67 &(?@  g&++-  Xh.!9 : g& l# l#^
  ,  8E i # !#L,^="-l lr   