
    ?gSS                    `   S SK Jr  S SKrS SKJr  S SKrS SKJr  S SKJr  S SKJ	r	  S SKJ
r
  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SK J!r!  S SK"J#r#  S SK"J$r$  S SK%J&r&  S SK%J'r'  \(       a  S S K(J)r)  S S!K*J+r+  S" r, " S# S$5      r-      S0S% jr.\
 " S& S'\-5      5       r/\
 " S( S)\-5      5       r0 " S* S+\5      r1    S1S, jr2    S2S- jr3S3S. jr4S4S/ jr5g)5    )annotationsN)StringIO)pprint)Any)cast)final)Iterable)Iterator)Literal)Mapping)NoReturn)Sequence)TYPE_CHECKING)ExceptionChainRepr)ExceptionInfo)ExceptionRepr)	ReprEntry)ReprEntryNative)ReprExceptionInfoReprFileLocation)ReprFuncArgs)
ReprLocalsReprTraceback)TerminalRepr)TerminalWriter)Config)	Collector)Item)fail)skip)Self)CallInfoc                     U R                   $ ! [         aI    U R                  nSR                  " US   S S 6 nSR                  US   US   X!S   5      =U l         nUs $ f = f)Nz{}.{}.{}version_info   z[{}] {} -- Python {} {}idsysplatform
executable)_workerinfocacheAttributeError
workerinfoformat)nodedverss       1/usr/lib/python3/dist-packages/_pytest/reports.pygetworkerinfoliner4   ,   s|    $$$ OO>!22A!67$=$D$DdGQ}%slO%
 	
 s    AA! A!c                     \ rS rSr% S\S'   S\S'   S\S'   S\S	'   S
\S'   S\S'   S!S jr\(       a  S"S jrS#S jrS$S jr	\
S%S j5       r\
S%S j5       r\
S%S j5       r\
S%S j5       r\
S&S j5       r\
S&S j5       r\
S&S j5       r\
S%S j5       r\
S&S j5       r\
S'S j5       r      S(S jrS)S jr\S*S j5       rSrg )+
BaseReport8   
str | Nonewhen"tuple[str, int | None, str] | NonelocationONone | ExceptionInfo[BaseException] | tuple[str, int, str] | str | TerminalReprlongreprzlist[tuple[str, str]]sectionsstrnodeid&Literal['passed', 'failed', 'skipped']outcomec                :    U R                   R                  U5        g N)__dict__update)selfkws     r3   __init__BaseReport.__init__B   s    R     c                    g rD    )rG   keys     r3   __getattr__BaseReport.__getattr__G   s    rK   c                d   [        U S5      (       a-  [        U R                  5      nU(       a  UR                  U5        U R                  nUc  g [        US5      (       a"  [        [        U5      nUR                  U5        g  [        U5      nUR                  U5        g ! [         a    Sn N f = f)Nr/   
toterminalz<unprintable longrepr>)
hasattrr4   r/   liner=   r   r   rR   r?   UnicodeEncodeError)rG   outworker_infor=   longrepr_terminalr2   s         r3   rR   BaseReport.toterminalI   s    4  +DII6K%==8\** $\8 <((--M HHQK & -,-s   B   B/.B/c              #  p   #    U R                    H"  u  p#UR                  U5      (       d  M  X4v   M$     g 7frD   )r>   
startswith)rG   prefixnamecontents       r3   get_sectionsBaseReport.get_sections]   s,     !]]MDv&&o% +s   &6
6c                    [        5       n[        U5      nSUl        U R                  U5        UR	                  5       nUR                  5       $ )zgRead-only property that returns the full string representation of
``longrepr``.

.. versionadded:: 3.0
F)r   r   	hasmarkuprR   getvaluestrip)rG   filetwexcs       r3   longreprtextBaseReport.longreprtextb   s?     zD!mmoyy{rK   c                P    SR                  S U R                  S5       5       5      $ )zOReturn captured log lines, if log capturing is enabled.

.. versionadded:: 3.5

c              3  *   #    U  H	  u  pUv   M     g 7frD   rM   .0r\   r^   s      r3   	<genexpr>$BaseReport.caplog.<locals>.<genexpr>v   s      
-N)G-N   zCaptured logjoinr_   rG   s    r3   caplogBaseReport.caplogp   s-     yy 
-1->->~-N
 
 	
rK   c                P    SR                  S U R                  S5       5       5      $ )zRReturn captured text from stdout, if capturing is enabled.

.. versionadded:: 3.0
 c              3  *   #    U  H	  u  pUv   M     g 7frD   rM   rm   s      r3   ro   'BaseReport.capstdout.<locals>.<genexpr>         
-Q)G-Qrq   zCaptured stdoutrr   rt   s    r3   	capstdoutBaseReport.capstdoutz   .     ww 
-1->->?P-Q
 
 	
rK   c                P    SR                  S U R                  S5       5       5      $ )zRReturn captured text from stderr, if capturing is enabled.

.. versionadded:: 3.0
rx   c              3  *   #    U  H	  u  pUv   M     g 7frD   rM   rm   s      r3   ro   'BaseReport.capstderr.<locals>.<genexpr>   r{   rq   zCaptured stderrrr   rt   s    r3   	capstderrBaseReport.capstderr   r~   rK   c                     U R                   S:H  $ )zWhether the outcome is passed.passedrB   rt   s    r3   r   BaseReport.passed        ||x''rK   c                     U R                   S:H  $ )zWhether the outcome is failed.failedr   rt   s    r3   r   BaseReport.failed   r   rK   c                     U R                   S:H  $ )zWhether the outcome is skipped.skippedr   rt   s    r3   r   BaseReport.skipped   s     ||y((rK   c                >    U R                   R                  S5      S   $ )z3The path portion of the reported node, as a string.z::r   )r@   splitrt   s    r3   fspathBaseReport.fspath   s     {{  &q))rK   c                    g)a  **Experimental** Whether this report should be counted towards the
totals shown at the end of the test session: "1 passed, 1 failure, etc".

.. note::

    This function is considered **experimental**, so beware that it is subject to changes
    even in patch releases.
TrM   rt   s    r3   count_towards_summary BaseReport.count_towards_summary   s     rK   c                @    U R                   b  U R                   u  pnU$ g)ab  **Experimental** The head line shown with longrepr output for this
report, more commonly during traceback representation during
failures::

    ________ Test.foo ________


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

.. note::

    This function is considered **experimental**, so beware that it is subject to changes
    even in patch releases.
N)r;   )rG   r   linenodomains       r3   	head_lineBaseReport.head_line   s$      ==$%)]]"FFMrK   c                6   UR                   R                  XS9u  p4n[        U[        5      (       a  XR4$ [        U[        5      (       a@  [        U5      S:X  a1  Uu  pg[        U[        5      (       a  [        U[        5      (       a  Xg4$ [        SU< S35        g )N)reportconfig   zSpytest_report_teststatus() hook (from a plugin) returned an invalid verbose value: z8.
Expected either a string or a tuple of (word, markup).)hookpytest_report_teststatus
isinstancer?   r   lenr   r!   )rG   r   default_markup	_category_shortverbosewordmarkups           r3   _get_verbose_word_with_markup(BaseReport._get_verbose_word_with_markup   s     &,[[%I%I &J &
"	7 gs##**gx((S\Q->"LD$$$FG)D)D|#))0 4,,	
rK   c                    [        U 5      $ )zReturn the contents of this report as a dict of builtin entries,
suitable for serialization.

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

Experimental method.
)_report_to_jsonrt   s    r3   _to_jsonBaseReport._to_json   s     t$$rK   c                (    [        U5      nU " S0 UD6$ )zCreate either a TestReport or CollectReport, depending on the calling class.

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

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

Experimental method.
rM   )_report_kwargs_from_json)cls
reportdictkwargss      r3   
_from_jsonBaseReport._from_json   s     **5}V}rK   rM   N)rH   r   returnNone)rN   r?   r   r   rV   r   r   r   )r\   r?   r   zIterator[tuple[str, str]]r   r?   )r   bool)r   r8   )r   r   r   zMapping[str, bool]r   ztuple[str, Mapping[str, bool]])r   dict[str, Any])r   zdict[str, object]r   r#   )__name__
__module____qualname____firstlineno____annotations__rI   r   rO   rR   r_   propertyrh   ru   r|   r   r   r   r   r   r   r   r   r   classmethodr   __static_attributes__rM   rK   r3   r6   r6   8   s>   
00W $#K33! 3(&
   
 
 
 
 
 
 ( ( ( ( ) ) * * 	 	  (

.@
	'
*% 
 
rK   r6   c                    Sn[        5       n[        SUS9  [        SU  3US9  [        SU 3US9  [        X$S9  [        SU 3US9  [        SUS9  [        UR                  5       5      e)Nz+https://github.com/pytest-dev/pytest/issueszd----------------------------------------------------------------------------------------------------)streamz,INTERNALERROR: Unknown entry type returned: zreport_name: zPlease report this bug at )r   r   RuntimeErrorrc   )	type_namereport_classr   urlr   s        r3   _report_unserialization_failurer      ss     8CZF
9V$
9)EfU
]<.)&9
:%
'u-f=
9V$
v(
))rK   c                      \ rS rSr% SrSrS\S'        S                       SS jjrSS jr\	SS	 j5       r
S
rg)
TestReport   zBasic test report object (also used for setup and teardown calls if
they fail).

Reports can contain arbitrary extra attributes.
Fr?   wasxfailNc                    Xl         X l        X0l        X@l        XPl        X`l        [        U=(       d    / 5      U l        [        U5      U l        Xl	        Xl
        Xl        U R                  R                  U5        g rD   )r@   r;   keywordsrB   r=   r9   listuser_propertiesr>   durationstartstoprE   rF   )rG   r@   r;   r   rB   r=   r9   r>   r   r   r   r   extras                r3   rI   TestReport.__init__  sr    (  6> ,4  ! 	  $O$9r: X  ( "
	U#rK   c           	         SU R                   R                   SU R                  < SU R                  < SU R                  < S3	$ )N< z when=	 outcome=>)	__class__r   r@   r9   rB   rt   s    r3   __repr__TestReport.__repr__I  s?    4>>**+1T[[O6$))iX\XdXdWgghiirK   c                &   UR                   nUS:w  d   eUR                  nUR                  nUR                  nUR                   Vs0 s H  owS_M     nnUR
                  n	/ n
UR
                  (       d  SnSnGO6[        U	[        5      (       d  SnU	nGO[        U	R                  [        R                  5      (       a  SnU	R                  5       nUc   S5       eU	R                  R                  (       aA  UR                  5       SS u  pUc   e[        R                  " U5      US-   UR                   4nOz[#        UR$                  5      UR&                  UR                   4nOMSnUR                   S	:X  a  UR)                  U	5      nO)UR+                  XR,                  R/                  S
S5      S9nUR0                   H   u  nnnU
R3                  SU SU 3U45        M"     U " UR4                  UR6                  UUUUU
UUUUR8                  S9$ s  snf )zsCreate and fill a TestReport with standard item and call info.

:param item: The item.
:param call: The call info.
collect   r   Nr   r   z=There should always be a traceback entry for skipping a test.r   calltbstyleauto)stylez	Captured r   )r   )r9   r   r   r   r   excinfor   r   valuer"   	Exception_getreprcrash_use_item_location
reportinfoosr   messager?   pathr   repr_failure_repr_failure_pyr   	getoption_report_sectionsappendr@   r;   r   )r   itemr   r9   r   r   r   xr   r   r>   rB   r=   rr   rT   rwhenrN   r^   s                      r3   from_item_and_callTestReport.from_item_and_callL  s    yyy   ==

yy"&--0-QqD-0,,||>FG   g}55""GMM4>>::#))+MSRS!==33!%!22A!6JD+++!yyq!))CH #AFFQXXqyyAH"99&#009H#44{{'<'<Y'O  5  H $(#8#8E3OOyQug6@A $9KKMM 00
 	
M 1s   H)r   r   r;   r=   r@   rB   r>   r   r   r   r9   )rM   r   r   r   N)r@   r?   r;   ztuple[str, int | None, str]r   zMapping[str, Any]rB   rA   r=   r<   r9   z$Literal['setup', 'call', 'teardown']r>   Iterable[tuple[str, str]]r   floatr   r   r   r   r   z#Iterable[tuple[str, object]] | Noner   r   r   )r   r    r   zCallInfo[None]r   r   )r   r   r   r   __doc____test__r   rI   r   r   r   r   rM   rK   r3   r   r      s     H M /1?C!<$<$ .<$ $	<$
 8<$<$ 3<$ ,<$ <$ <$ <$  =!<$$ 
%<$|j >
 >
rK   r   c                  d    \ rS rSrSrSr S	           S
S jjr\  SS j5       rSS jr	Sr
g)CollectReporti  zKCollection report object.

Reports can contain arbitrary extra attributes.
r   c                    Xl         X l        X0l        U=(       d    / U l        [	        U5      U l        U R                  R                  U5        g rD   )r@   rB   r=   resultr   r>   rE   rF   )rG   r@   rB   r=   r  r>   r   s          r3   rI   CollectReport.__init__  sC       ! l XU#rK   c                4    U R                   S U R                   4$ rD   )r   rt   s    r3   r;   CollectReport.location  s     T4;;//rK   c                l    SU R                   < S[        U R                  5       SU R                  < S3$ )Nz<CollectReport z lenresult=r   r   )r@   r   r  rB   rt   s    r3   r   CollectReport.__repr__  s4     {3t{{;K:LIVZVbVbUeefggrK   )r=   r@   rB   r  r>   N)rM   )r@   r?   rB   rA   r=   r<   r  zlist[Item | Collector] | Noner>   r   r   r   )r   r:   r   )r   r   r   r   r   r9   rI   r   r;   r   r   rM   rK   r3   r   r     su    
 D /1$$ 8$	$ .$ ,$ 
$B 0	+0 0
hrK   r   c                  (    \ rS rSrSS jrSS jrSrg)CollectErrorRepri  c                    Xl         g rD   r=   )rG   msgs     r3   rI   CollectErrorRepr.__init__  s    rK   c                8    UR                  U R                  SS9  g )NT)red)rT   r=   )rG   rV   s     r3   rR   CollectErrorRepr.toterminal  s    D)rK   r  N)r  r?   r   r   r   )r   r   r   r   rI   rR   r   rM   rK   r3   r	  r	    s    *rK   r	  c                    [        U [        [        45      (       a+  U R                  5       nU R                  R
                  US'   U$ g )N$report_type)r   r   r   r   r   r   )r   datas     r3   pytest_report_to_serializabler    s@     &:}566 %//88^rK   c                    SU ;   aU  U S   S:X  a  [         R                  U 5      $ U S   S:X  a  [        R                  U 5      $  SR                  U S   5      5       eg )Nr  r   r   z(Unknown report_type unserialize data: {})r   r   r   r.   )r  s    r3   pytest_report_from_serializabler    so     </((...!_4 ++D11	
@GG 
 	
u rK   c                4  ^^^     SS jmSU4S jjm    SS jmSUU4S jjnU R                   R                  5       n[        U R                  S5      (       a[  [        U R                  S5      (       a'  [        U R                  S5      (       a  U" U 5      US'   O([	        U R                  5      US'   OU R                  US'   U HL  n[        X#   [        R                  5      (       a  [        R                  " X#   5      X#'   M@  US	:X  d  MH  S
X#'   MN     U$ )zReturn the contents of this report as a dict of builtin entries,
suitable for serialization.

This was originally the serialize_report() function from xdist (ca03269).
c                    [         R                  " U 5      nUR                  5        H0  u  p#[        US5      (       d  M  [         R                  " U5      X'   M2     [	        U 5      R
                  US.nU$ )NrE   )typer  )dataclassesasdictitemsrS   r  r   )entryr  rN   r   
entry_datas        r3   serialize_repr_entry-_report_to_json.<locals>.serialize_repr_entry  sa     !!%(**,JCuj))'..u5	 ' #5k22DA
rK   reprtracebackc                   > [         R                  " U 5      nU R                   Vs/ s H  nT" U5      PM     snUS'   U$ s  snf )Nreprentries)r  r  r#  )r!  r  r   r  s      r3   serialize_repr_traceback1_report_to_json.<locals>.serialize_repr_traceback  sJ    ##M2-:-F-F!
-F #-F!
} !
s   A 	reprcrashc                6    U b  [         R                  " U 5      $ g rD   )r  r  )r&  s    r3   serialize_repr_crash-_report_to_json.<locals>.serialize_repr_crash  s      %%i00rK   c                n  > U R                   c   e[        [        U R                   5      nT" UR                  5      T" UR                  5      UR
                  S.n[        U[        5      (       a@  / US'   UR                   H)  u  p4nUS   R                  T" U5      T" U5      U45        M+     U$ S US'   U$ )N)r&  r!  r>   chain)
r=   r   r   r&  r!  r>   r   r   r+  r   )repr=   r  repr_traceback
repr_crashdescriptionr(  r$  s         r3   serialize_exception_longrepr5_report_to_json.<locals>.serialize_exception_longrepr  s    ||'''s||4-h.@.@A5h6L6LM ))"

 h 233 F7O;C>>7Kw&&0@,Z8# <J  #F7OrK   rR   r=   r  N)r  zReprEntry | ReprEntryNativer   r   )r!  r   r   r   )r&  zReprFileLocation | Noner   dict[str, Any] | None)r,  r6   r   r   )	rE   copyrS   r=   r?   r   r   PathLiker   )r   r0  r0   r]   r(  r  r$  s       @@@r3   r   r     s    *	*	 . 	Av--6??O44OO[:
 :
 9@AjM0AjM*agr{{++ii(AGXAG	 
 HrK   c                  ^ ^ U 4S jmU4S jnS
S jnT S   (       a  ST S   ;   a  ST S   ;   a  U" T S   S   5      nU" T S   S   5      nT S   S   (       a@  / nT S   S    H&  u  pgnUR                  U" U5      U" U5      U45        M(     [        U5      n	O
[        UUS9n	T S   S	    H  n
U	R                  " U
6   M     U	T S'   T $ )zReturn **kwargs that can be used to construct a TestReport or
CollectReport instance.

This was originally the serialize_report() function from xdist (ca03269).
c                B  > U S   nU S   nUS:X  af  S nS nS nUS   (       a  [        S0 US   D6nUS   (       a  [        S0 US   D6nUS   (       a  [        US   S   5      n[        US   UUUUS   S	9nU$ US
:X  a  [	        US   5      nU$ [        U[        T5        W$ )Nr  r  r   reprfuncargsreprfileloc
reprlocalslinesr   )r:  r7  r9  r8  r   r   rM   )r   r   r   r   r   r   r   )r  r  
entry_typer7  r8  r9  	reprentryr   s          r3   deserialize_repr_entry8_report_kwargs_from_json.<locals>.deserialize_repr_entry3  s    &!'
$LKJN#+Cd>.BCM".Em1DEL!'\(:7(CD
5>7m)%'7m6I 	 ,,'W6I  ,J
JOrK   c                b   > U S    Vs/ s H  nT" U5      PM     snU S'   [        S0 U D6$ s  snf )Nr#  rM   r   )repr_traceback_dictr   r=  s     r3   deserialize_repr_traceback<_report_kwargs_from_json.<locals>.deserialize_repr_tracebackN  sD    /B=/Q.
/Q!"1%/Q.
M* 3233.
s   ,c                     U b  [        S0 U D6$ g )NrM   r   )repr_crash_dicts    r3   deserialize_repr_crash8_report_kwargs_from_json.<locals>.deserialize_repr_crashT  s    &#6o66rK   r=   r&  r!  r+  )r!  r&  r>   )rD  r2  )r   r   r   
addsection)r   rA  rE  r!  r&  r+  repr_traceback_datarepr_crash_datar/  exception_infosectionr=  s   `          @r3   r   r   ,  s   64 	::j11z*552z"?3
 +:j+A++NO	j!'*EEOFFA#k 23FG.?#F FXFN /+#N
 "*-j9G%%w/ :!/
:rK   )r   r?   r   ztype[BaseReport]r   r   )r   zCollectReport | TestReportr   r2  )r  r   r   z!CollectReport | TestReport | None)r   r6   r   r   )r   r   r   r   )6
__future__r   r  ior   r   r   typingr   r   r   r	   r
   r   r   r   r   r   _pytest._code.coder   r   r   r   r   r   r   r   r   r   r   _pytest._ior   _pytest.configr   _pytest.nodesr   r    _pytest.outcomesr!   r"   typing_extensionsr#   _pytest.runnerr$   r4   r6   r   r   r   r	  r  r  r   r   rM   rK   r3   <module>rV     s    "   	             1 , , ( . 0 / + ) , + & ! #  ! ! &'	u up**"2** L
 L
 L
^ 0hJ 0h 0hf*| *&
&FRPrK   