+
    -jc                       R t ^ RIHt ^ RIHt ^ RIt^ RIt^ RIt^ RI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#RRRR./RR. R2O//t$]$R,          PK                  4       ]$R&   ]#! ]$R,          ]$R,          4       ]$R,          ]$R&    ! R R4      t&R R lt'] PP                  R R  l4       t)] PP                  R! R" l4       t*R# R$ lt+] PP                  ! R%R&7      R' R( l4       t,R) R* lt-R+ R, lt.R- R. lt/R/ R0 lt0 ! R1 R4      t1R# )3a  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)CallableN)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   "e/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/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re.Match[str]r   r   r   )r   s   "r   r   $bin_xml_escape.<locals>.__annotate__0   s        }    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>.repl0   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   @   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_familyr>   @   s^    F**,kkmFBb$''R))FJ $ 
 	KKr   _basetestcase	classnamename_base_legacyxunit1xunit2c                      ] tR t^Vt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   r.   r   )r   s   "r   r   _NodeReporter.__annotate__W   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)idrJ   	add_statsfamilyduration
propertiesr   attrs)selfrI   rJ   s   &&&r   __init___NodeReporter.__init__W   sH    ++hhoo13')
%'
r   c                    V ^8  d   QhRRRR/# )r   node
ET.Elementr   r.   r   )r   s   "r   r   rK   a   s        :  $  r   c                	    V P                   P                  VP                  4       V P                  P	                  V4       R # r0   )rJ   rO   tagr   append)rT   rX   s   &&r   r\   _NodeReporter.appenda   s*    488$

$r   c               $    V ^8  d   QhRRRRRR/# r   rB   r   valuer   r   r.   r   )r   s   "r   r   rK   e   s&     C C CV C Cr   c                	d    V P                   P                  \        V4      \        V4      34       R # r0   )rR   r\   r   r+   rT   rB   r`   s   &&&r   add_property_NodeReporter.add_propertye   s"    D	>%+@ABr   c               $    V ^8  d   QhRRRRRR/# r_   r   )r   s   "r   r   rK   h   s!     6 6# 6f 6 6r   c                	H    \        V4      V P                  \        V4      &   R # r0   )r+   rS   r   rb   s   &&&r   add_attribute_NodeReporter.add_attributeh   s     .u 5

3t9r   c                   V ^8  d   QhRR/# r   r   zET.Element | Noner   )r   s   "r   r   rK   k   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.rR   propertyrB   r`   N)rR   ETElementr\   rT   rR   rB   r`   s   &   r   make_properties_node"_NodeReporter.make_properties_nodek   sK    ???L1J#!!"**Zd"PQ  /r   c                    V ^8  d   QhRRRR/# )r   
testreportr   r   r.   r   )r   s   "r   r   rK   t   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 # )
NrA   .rB   filelineurlrD   r@   )mangle_test_addressrI   rS   rJ   prefixinsertjoinr+   locationr   hasattrrz   r6   rP   families)rT   ru   namesexisting_attrs
classnamesrS   
temp_attrskeys   &&      r   record_testreport_NodeReporter.record_testreportt   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   rY   r   )r   s   "r   r   rK      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# )r@   .3f)time)ro   rp   rS   rQ   rr   r\   extendr   )rT   r@   rR   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   r.   r   )r   s   "r   r   rK      s(      s S 
 d r   c                	v    \         P                  ! WR 7      p\        V4      Vn        V P	                  V4       R# ))r   Nro   rp   r+   textr\   )rT   r[   r   r   rX   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   r.   r   )r   s   "r   r   rK      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   )	rJ   log_passing_testspassed	capstdoutcaplog	capstderrlogging_prepare_content_write_content)rT   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   rK      s&     @ @ @S @S @r   c                	J    R P                  VP                  ^PR4      VR.4      # )
-r   )r   center)rT   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   r.   r   )r   s   "r   r   rK      s)      Z #  PT r   c                	t    \         P                  ! V4      p\        V4      Vn        V P	                  V4       R # r0   r   )rT   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   rK      s     ! !* ! !r   c                	(    V P                  R 4       R# )r   N)rO   rT   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   rK      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+   )rT   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   rK      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   rK      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   rK      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+   )rT   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   rK      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)r5   r   z	Skipped: :	   NN:z: zpytest.skipN)r   r   
startswithr+   ro   rp   r\   r2   r   tupler   r   )rT   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/# r-   r   )r   s   "r   r   rK      s     # #$ #r   c                	r   a V P                  4       oV P                  P                  4        V3R  lV n         R# )c                    < S # r0   r   )r   s   r   <lambda>(_NodeReporter.finalize.<locals>.<lambda>  s    dr   N)r   __dict__clear)rT   r   s   &@r   finalize_NodeReporter.finalize   s'    {{} #r   )	rO   rS   rQ   rP   rN   r   rR   r   rJ   r0   )__name__
__module____qualname____firstlineno__rU   r\   rc   rg   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r   r   r   rG   rG   V   sh    ( C6 <
C.@
!G N
PM/,# #r   rG   c               $    V ^8  d   QhRRRRRR/# )r   requestr   fixture_namer   r   r.   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'))rD   legacy)	_pytest.warning_typesr   configstashgetxml_keyrP   rX   warn)r   r   r   rJ   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/# r_   r   )r   s   "r   r   %record_property.<locals>.__annotate__%  s!     ; ;c ;& ;T ;r   c                T   < SP                   P                  P                  W34       R # r0   )rX   user_propertiesr\   )rB   r`   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/# r_   r   )r   s   "r   r   *record_xml_attribute.<locals>.__annotate__;  s!      C  4 r   c                    R # r0   r   rn   s   &&r   add_attr_noop+record_xml_attribute.<locals>.add_attr_noop;  s    r   N)r  r  rX   r  r  r  r  r  r  node_reporterrI   rg   )r   r  r  	attr_funcrJ   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   r.   r   )r   s   "r   r   r   H  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)r2   r   r4   r   r5   r   )r  r   __tracebackhide__r   s   &&  r   _check_record_param_typer$  H  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   R  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/# r_   r   )r   s   "r   r   /record_testsuite_property.<locals>.__annotate__m  s!     / /# /f / /r   c                "    Rp\        RV 4       R# )zFNo-op function in case --junit-xml was not passed in the command-line.TrB   N)r$  )rB   r`   r#  s   && r   record_func.record_testsuite_property.<locals>.record_funcm  s      .r   N)r  r  r  r  add_global_property)r   r#  r,  rJ   s   &   r   record_testsuite_propertyr/  Q  sC    4 /
 ..


"
"7D
1C
--r   c                    V ^8  d   QhRRRR/# )r   parserr
   r   r.   r   )r   s   "r   r   r   x  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metavarr5   defaulthelpz--junitprefixz--junit-prefixr   z0Prepend prefix to classnames in junit-xml output)r7  r9  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)r5   r:  junit_duration_reportz*Duration time to report: one of total|calltotaljunit_familyz0Emit XML for schema: one of legacy|xunit1|xunit2rE   )getgroup	addoption	functoolspartialr	   addini)r1  r$   s   & r   pytest_addoptionrI  x  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   r.   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# )workerinputrC  r<  r>  rA  r?  N)
optionr4  r   getinir   junitprefixr  r  pluginmanagerregister)r  r4  rC  s   &  r   pytest_configurerS    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/# rK  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 # r0   )r  r  r  rQ  
unregister)r  rJ   s   & r   pytest_unconfigurerW    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::rw   z\.py$r   r{   )	partitionsplitreplacer   SEPr(   r)   )rY  r5  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   r@  r   r.   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  rD   N)r   r   r   r   )osr5  
expanduser
expandvarsnormpathabspathlogfiler}   rd  r   r   re  rP   dictfromkeysstatsnode_reportersnode_reporters_orderedglobal_propertiesopen_reportscnt_double_fail_tests)rT   rm  r}   rd  r   re  rP   r   s   &&&&&&&&r   rU   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   rf    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# rI   rX   N)r   rq  popr  rc   r   r   )rT   r   rI   
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   rG   r   )r   s   "r   r   rf    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# ry  )r   rq  rG   rr  r\   )rT   r   rI   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   r.   r   )r   s   "r   r   rf  
  s     ! !S !T !r   c                	h    WP                   9   d"   V P                   V;;,          ^,          uu&   R# R# )   N)rp  )rT   r   s   &&r   rO   LogXML.add_stats
  s#    **JJsOq O r   c                    V ^8  d   QhRRRR/# )r   r   r   r   rG   r   )r   s   "r   r   rf    s      J = r   c                	J    V P                  V4      pVP                  V4       V# r0   )r  r   rT   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   rf    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  rI   r   .0repr   	report_ii
report_wids   & r   	<genexpr>2LogXML.pytest_runtest_logreport.<locals>.<genexpr>5  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  Z  sZ      0

fmm3  $Ct<	I	 
 $Cd;zI C0r  )r   r   r  r   failedr   nextrt  r   ru  r   r\   r   r   r   r   r   update_testcase_durationremove)rT   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   rf  h  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.rB  rQ   rM   N)re  r   r  rQ   r   r  s   && r   r  LogXML.update_testcase_durationh  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   rf  o  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 # r0   )r   r  r  r   r   r  s   && r   pytest_collectreportLogXML.pytest_collectreporto  sE    }}}))&1H}}}--f5//7 r   c                    V ^8  d   QhRRRR/# )r   excreprr   r   r.   r   )r   s   "r   r   rf  w  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=  )rA   rB   r   zinternal errorN)r  rS   r6   r   r   )rT   r  r|  s   && r   pytest_internalerrorLogXML.pytest_internalerrorw  s@    %%j1zBW&6GEr   c                   V ^8  d   QhRR/# r-   r   )r   s   "r   r   rf  |  s     , ,T ,r   c                	:    \         P                  ! 4       V n        R # r0   )r   Instantsuite_start)rT   s   &r   pytest_sessionstartLogXML.pytest_sessionstart|  s    !>>+r   c                   V ^8  d   QhRR/# r-   r   )r   s   "r   r   rf    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V P                  P                  4       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P                   R V P                  P#                  4       P%                  4       P'                  4       \(        P*                  ! 4       R7	      pV P-                  4       pVe   VP/                  V4       V P0                   F"  pVP/                  VP3                  4       4       K$  	  \        P                  ! R4      pVP5                  RR4       VP/                  V4       VP                  \        P6                  ! 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   )rB   errorsfailuresr   testsr   	timestamphostnameN
testsuitesrB   zpytest testsunicode)rh  r5  dirnamerl  rm  makedirsopenr  elapsedrp  ru  writero   rp   rd  r   secondsas_utc
astimezone	isoformatplatformrX   _get_global_properties_noder\   rr  r   settostring)	rT   r  rm  rQ   numtests
suite_noders  r  r  s	   &        r   pytest_sessionfinishLogXML.pytest_sessionfinish  s   ''//"''//$,,"?@
Gd+$,,g66'''//1H 

8$**Y'(**Y'( **W%& ,,	-  MMBC__4::g./TZZ	23DJJy12(m ((-**113>>@JJL!
J !% @ @ B ,!!"34!%!<!<!!-"6"6"89 "=L1JNN6>2j)MM"++j9EF? 7666s   ?H"J++J<	c               $    V ^8  d   QhRRRRRR/# )r   terminalreporterr   r  zpytest.Configr   r.   r   )r   s   "r   r   rf    s)     S S 0S:GS	Sr   c                	r    VP                  4       ^ 8  d"   VP                  RRV P                   24       R# R# )    r   zgenerated xml file: N)get_verbosity	write_seprm  )rT   r  r  s   &&&r   pytest_terminal_summaryLogXML.pytest_terminal_summary  s6     !Q&&&s.B4<<.,QR 'r   c               $    V ^8  d   QhRRRRRR/# r_   r   )r   s   "r   r   rf    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# )TrB   N)r$  rs  r\   r+   )rT   rB   r`   r#  s   &&& r   r.  LogXML.add_global_property  s0      .%%t^E-B&CDr   c                   V ^8  d   QhRR/# rj   r   )r   s   "r   r   rf    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# rl   )rs  ro   rp   r\   rq   s   &   r   r  "LogXML._get_global_properties_node  sP    !!!L1J#55!!"**Zd"PQ  6r   )ru  rP   rs  r   rm  r   rq  rr  rt  r}   re  rp  rd  r  N)r=  r   rB  rD   T)r   r   r   r   rU   r   r  rO   r  r  r  r  r  r  r  r  r.  r  r   r   r   r   r   r     sV    #B
 $!
S7jB8F
,$GLSE
 r   )rx   ry   rz   )2__doc__
__future__r   collections.abcr   rF  rh  r  r(   xml.etree.ElementTreeetreeElementTreero   _pytestr   r   _pytest._code.coder   r   _pytest.configr   r	   _pytest.config.argparsingr
   _pytest.fixturesr   _pytest.reportsr   _pytest.stashr   _pytest.terminalr   r=  r  r+   r>   r   copyrG   r  fixturer  r  r$  r/  rI  rS  rW  r|   r   r   r   r   <module>r     sJ   # $  	  	 " "   , / ! ' , + & " -  8

26 j;/0Z!89
 g&++-  Xh.!9 : g& l# l#^
  ,  8E i # !#L,^="-m mr   