
    XiIM                       S r SSKJr  SSKrSSKJr  SSKrSSKrSSK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+  \RX                  S:  a  SS K-J.r.  \(       a  SS!K/J0r0  SS"K1J2r2  S<S# jr3S=S$ jr4S>S% jr5S>S& jr6S?S' jr7 S@       SAS) jjr8SBS* jr9SBS+ jr:SBS, jr;SCS- jr<      SDS. jr=SES/ jr> SF       SGS0 jjr?SHS1 jr@SIS2 jrA\" S3S(S49rB\\R                   " S5 S6\\B   5      5       5       rDSJS7 jrESKS8 jrF " S9 S:5      rGSKS; jrHg)Lz3Basic collect and runtest protocol implementations.    )annotationsN)Callable)cast)final)Generic)Literal)TYPE_CHECKING)TypeVar   )Config)
BaseReport)CollectErrorRepr)CollectReport)
TestReport)timing)ExceptionChainRepr)ExceptionInfo)TerminalRepr)Parser)check_ispytest)	Collector)	Directory)Item)Node)Exit)OutcomeException)Skipped)TEST_OUTCOME)      )BaseExceptionGroup)Session)TerminalReporterc           	         U R                  SSSS9nUR                  SS[        S SSS	9  UR                  S
S[        S SSS	9  g )Nzterminal reporting	Reportinggeneral)afterz--durationsstoreNz1Show N slowest setup/test durations (N=0 for all))actiontypedefaultmetavarhelpz--durations-minzcMinimal duration in seconds for inclusion in slowest list. Default: 0.005 (or 0.0 if -vv is given).)getgroup	addoptionintfloat)parsergroups     A/var/www/html/venv/lib/python3.13/site-packages/_pytest/runner.pypytest_addoptionr6   3   sa    OO0+YOOE	OO@   
OO3      c                   U R                   R                  R                  nU R                   R                  R                  nU R                   R	                  5       nUc  g Uc
  US:  a  SOSnU n/ nUR
                  R                  5        H0  nU H'  n[        US5      (       d  M  UR                  U5        M)     M2     U(       d  g UR                  S SS9  U(       d  UR                  SS	5        OUR                  SS
U S35        US U n[        U5       H  u  pUR                  U:  ae  UR                  S5        S[        U5      U-
   SUS S3n	U R                   R                  R                  c  U	S-  n	U	S-  n	UR                  U	5          g UR                  UR                  S SUR                  S SUR                    35        M     g )N   g{Gzt?g        durationc                    U R                   $ N)r:   )xs    r5   <lambda>)pytest_terminal_summary.<locals>.<lambda>X   s    QZZr7   T)keyreverse=zslowest durationszslowest z
 durations (z durations < gz	s hidden.z"  Use -vv to show these durations.)z02.2fzs z<8 )configoption	durationsdurations_minget_verbositystatsvalueshasattrappendsort	write_sep	enumerater:   
write_linelenwhennodeid)
terminalreporterrJ   rK   verbosetrdlistreplistrepimessages
             r5   pytest_terminal_summaryr`   H   s    ''..88I$++22@@M%%335G!(1#	BE88??$CsJ''S!  % 	JJ'J6
S-.
SHYKz:;jy!E"<<-'MM"#e*q.)}Q6GyQG&&--;;C??sNGMM'"
e,Bsxxm1SZZLIJ #r7   c                "    [        5       U l        g r<   )
SetupState_setupstatesessions    r5   pytest_sessionstartrf   k   s    $,Gr7   c                :    U R                   R                  S 5        g r<   )rc   teardown_exactrd   s    r5   pytest_sessionfinishri   o   s    &&t,r7   c                    U R                   nUR                  U R                  U R                  S9  [	        XS9  UR                  U R                  U R                  S9  g)N)rW   locationnextitemT)ihookpytest_runtest_logstartrW   rk   runtestprotocolpytest_runtest_logfinish)itemrm   rn   s      r5   pytest_runtest_protocolrs   s   sL    JJE	!!t}}!MD,	""$++"Nr7   Tc           	     P   [        U S5      nU(       a!  U R                  (       d  U R                  5         [        U SU5      nU/nUR                  (       ai  U R
                  R                  SS5      (       a  [        U 5        U R
                  R                  SS5      (       d  UR                  [        U SU5      5        U R                  R                  (       d  U R                  R                  (       a  S nUR                  [        U SXS95        U(       a  SU l        S U l        U$ )	N_requestsetup	setupshowF	setuponlycallteardownrl   )rO   ru   _initrequestcall_and_reportpassedrH   	getoptionshow_test_itemrP   re   
shouldfail
shouldstopfuncargs)rr   logrm   
hasrequestr]   reportss         r5   rp   rp   {   s     z*J$-- 	
$
-CeG
zz;;  e444 {{$$[%88NN?4=> ||$,,"9"9NN?4SLM Nr7   c                h   U R                   R                  5       nUR                  5         UR                  S5        UR                  U R                  5        [        [        U S/ 5      5      nU(       a/  UR                  SR                  SR                  U5      5      5        UR                  5         g)zAShow test function, parameters and the fixtures of the test item.z        fixturenamesz (fixtures used: {})z, N)
rH   get_terminal_writerlinewriterW   sortedgetattrformatjoinflush)rr   twused_fixturess      r5   r   r      sy    		(	(	*BGGIHHWHHT[[74<=M
'..tyy/GHIHHJr7   c                f    [        U S5        U R                  R                  R                  U 5        g )Nrv   )_update_current_test_varre   rc   rv   )rr   s    r5   pytest_runtest_setupr      s$    T7+LL""4(r7   c                   [        U S5         [        ?[        ?[        ?[        R
                  S:  a  [        ? U R                  5         g ! [         a     Nf = f! [         ar  n[        U5      [        l        U[        l        [        R
                  S:  a  U[        l        UR                  c   eUR                  R                  [        l        e S nAff = f)Nry   )r      r   )r   sys	last_type
last_valuelast_tracebackversion_infolast_excAttributeErrorruntest	Exceptionr+   __traceback__tb_next)rr   es     r5   pytest_runtest_callr      s    T6*MNz)    	Qz)CL***__44	s)   ,A A 
AA
C&A-CCc                ~    [        U S5        U R                  R                  R                  U5        [        U S 5        g )Nrz   )r   re   rc   rh   )rr   rm   s     r5   pytest_runtest_teardownr      s.    T:.LL++H5T4(r7   c                    SnU(       a8  U R                    SU S3nUR                  SS5      nU[        R                  U'   g[        R                  R	                  U5        g)zUpdate :envvar:`PYTEST_CURRENT_TEST` to reflect the current item and stage.

If ``when`` is None, delete ``PYTEST_CURRENT_TEST`` from the environment.
PYTEST_CURRENT_TESTz (rF    z(null)N)rW   replaceosenvironpop)rr   rV   var_namevalues       r5   r   r      sP     %H;;-r$q)fh/$

8


x r7   c                n    U R                   S;   a%  U R                  (       a  gU R                  (       a  ggg )N)rv   rz   )errorEERROR)skippedsSKIPPED)rC   rC   rC   )rV   failedr   reports    r5   pytest_report_teststatusr      s)    {{++==(^^,r7   c                  ^ ^^ T R                   nUS:X  a  UR                  mO0US:X  a  UR                  mOUS:X  a  UR                  mO
 SU 35       e[        R                  U UU4S jU[        T R                  5      S9nUR                  T US9nU(       a  UR                  US9  [        XV5      (       a  UR                  T XVS	9  U$ )
Nrv   ry   rz   zUnhandled runtest hook case: c                    > T" SST 0TD6$ )Nrr    r   )rr   kwdsruntest_hooks   r5   r>   !call_and_report.<locals>.<lambda>   s    /$/$/r7   )rV   reraiserr   ry   r   nodery   r   )rn   r   r   r   CallInfo	from_callget_reraise_exceptionsrH   pytest_runtest_makereportpytest_runtest_logreportcheck_interactive_exceptionpytest_exception_interact)rr   rV   r   r   rn   ry   r   r   s   `  `   @r5   r|   r|      s     JJEw,1,F,F	00		44<5dV<<u/&t{{3  D
 88d8NF
&&f&5"400''T'LMr7   c                V    [         4nU R                  SS5      (       d
  U[        4-  nU$ )z@Return exception types that should not be suppressed in general.usepdbF)r   r~   KeyboardInterrupt)rH   r   s     r5   r   r     s/    04wGHe,,%''Nr7   c                    U R                   c  g[        US5      (       a  g[        U R                   R                  [        [
        R                  -  5      (       a  gg)zRCheck whether the call raised an exception that should be reported as
interactive.FwasxfailT)excinforO   
isinstancer   r   bdbBdbQuit)ry   r   s     r5   r   r   	  sG     ||vz""$,,$$g&;<<r7   TResult)	covariantc                      \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'   S\S
'   S\S'   SS.               SS jjr\SS j5       r\	 S       SS jj5       r
SS jrSrg)r   i  z/Result/Exception info of a function invocation.TResult | None_result#ExceptionInfo[BaseException] | Noner   r2   startstopr:   /Literal['collect', 'setup', 'call', 'teardown']rV   F)	_ispytestc               b    [        U5        Xl        X l        X0l        X@l        XPl        X`l        g r<   )r   r   r   r   r   r:   rV   )selfresultr   r   r   r:   rV   r   s           r5   __init__CallInfo.__init__,  s*     	y!
	 	r7   c                n    U R                   b  [        U < S35      e[        [        U R                  5      $ )z\The return value of the call, if it didn't raise.

Can only be accessed if excinfo is None.
z has no valid result)r   r   r   r   r   r   s    r5   r   CallInfo.result?  s4     <<# D8+?!@AA GT\\**r7   Nc           
     h   Sn[         R                  " 5       n U" 5       nUR                  5       nU " UR                  R                  UR                  R                  UR                  UUUSS9$ ! [         a9    [        R                  " 5       nUb  [        UR                  U5      (       a  e Sn Nf = f)ag  Call func, wrapping the result in a CallInfo.

:param func:
    The function to call. Called without arguments.
:type func: Callable[[], _pytest.runner.TResult]
:param when:
    The phase in which the function is called.
:param reraise:
    Exception or exceptions that shall propagate if raised by the
    function, instead of being wrapped in the CallInfo.
NT)r   r   r:   rV   r   r   r   )r   InstantBaseExceptionr   from_currentr   r   elapsedr   timer   seconds)clsfuncrV   r   r   instantr   r:   s           r5   r   CallInfo.from_callL  s    $ .."	%)VF ??$..%%##%%
 	
  	#002G"z'--'I'IF		s   A. .A B10B1c                    U R                   c  SU R                  < SU R                  < S3$ SU R                  < SU R                   < S3$ )Nz<CallInfo when=z	 result: >z	 excinfo=)r   rV   r   r   s    r5   __repr__CallInfo.__repr__r  sH    <<$TYYM4<<:J!LL Yt||6FaHHr7   )r   r:   r   r   r   rV   )r   r   r   r   r   r2   r   r2   r:   r2   rV   r   r   boolreturnNone)r   r   r<   )r   zCallable[[], TResult]rV   r   r   z<type[BaseException] | tuple[type[BaseException], ...] | Noner   zCallInfo[TResult])r   str)__name__
__module____qualname____firstlineno____doc____annotations__r   propertyr   classmethodr   r   __static_attributes__r   r7   r5   r   r     s     :00L
KO
99   5 	
   >  
& 
+ 
+ 
 QU	#
##
 >#
 N	#

 
#
 #
JIr7   r   c                .    [         R                  " X5      $ r<   )r   from_item_and_callr   s     r5   r   r   x  s    ((44r7   c                  ^  S
U 4S jjn[         R                  US[        [        4S9nS nUR                  (       d  SnGOI[
        /n[        R                  R                  S5      nUb  UR                  UR                  5        [        UR                  R                  [        U5      5      (       a  SnT R                  UR                  S5      n[        U[        5      (       d   [!        U5      5       eUR"                  nU(       d   e[%        UR&                  5      UR(                  UR*                  4nORSnT R-                  UR                  5      n	[/        U	S	5      (       d"  [        U	[$        5      (       d   e[1        U	5      n	U	nUR                  (       d  UR2                  OS n
[5        T R6                  XCU
5      nX+l        U$ )Nc                 L  > [        T [        5      (       av  T R                  R                  R	                  T R
                  T R                  R                  S5      T R                  R                  T R                  R                  S5      S9  [        T R                  5       5      $ )N
importmodeconsider_namespace_packages)rootpathr  )r   r   rH   pluginmanager_loadconftestmodulespathr~   r  getinilistcollect	collectors   r5   r  +pytest_make_collect_report.<locals>.collect}  s     i++**??  **<8"))22,5,<,<,C,C1-	 @  I%%'((r7   r  )r   r}   unittestr   r   r   
toterminal)r   zlist[Item | Collector])r   r   r   
SystemExitr   r   r   modulesgetrP   SkipTestr   r   tuple_repr_failure_pyr   repr	reprcrashr   r  linenor_   repr_failurerO   r   r   r   rW   ry   )r  r  ry   longreproutcomeskip_exceptionsr  r_r	errorinfor   r]   s   `           r5   pytest_make_collect_reportr$  |  sk   )& %6
$C  D BFH<<:B");;??:.""8#4#45dll((%*@AAG++DLL&ABb"455?tBx?5AH1AFFQXXqyy9HG!..t||<I9l33!)S1111,Y7	 H $T[[$F
	(('V
DCHJr7   c                  @    \ rS rSrSrS	S jrS
S jrSS jrSS jrSr	g)rb   i  a  Shared state for setting up/tearing down test items or collectors
in a session.

Suppose we have a collection tree as follows:

<Session session>
    <Module mod1>
        <Function item1>
    <Module mod2>
        <Function item2>

The SetupState maintains a stack. The stack starts out empty:

    []

During the setup phase of item1, setup(item1) is called. What it does
is:

    push session to stack, run session.setup()
    push mod1 to stack, run mod1.setup()
    push item1 to stack, run item1.setup()

The stack is:

    [session, mod1, item1]

While the stack is in this shape, it is allowed to add finalizers to
each of session, mod1, item1 using addfinalizer().

During the teardown phase of item1, teardown_exact(item2) is called,
where item2 is the next item to item1. What it does is:

    pop item1 from stack, run its teardowns
    pop mod1 from stack, run its teardowns

mod1 was popped because it ended its purpose with item1. The stack is:

    [session]

During the setup phase of item2, setup(item2) is called. What it does
is:

    push mod2 to stack, run mod2.setup()
    push item2 to stack, run item2.setup()

Stack:

    [session, mod2, item2]

During the teardown phase of item2, teardown_exact(None) is called,
because item2 is the last item. What it does is:

    pop item2 from stack, run its teardowns
    pop mod2 from stack, run its teardowns
    pop session from stack, run its teardowns

Stack:

    []

The end!
c                    0 U l         g r<   stackr   s    r5   r   SetupState.__init__  s      	
r7   c                   UR                  5       nU R                  R                  5        H2  u  nu  pEX2;   d   S5       eU(       d  M  US   R                  US   5      e   U[	        U R                  5      S  HA  nX0R                  ;  d   eUR
                  /S4U R                  U'    UR                  5         MC     g! [         a2  nU R                  U   S   XUR                  44U R                  U'   e SnAff = f)z4Setup objects along the collector chain to the item.z(previous item was not torn down properlyr   r   N)		listchainr(  itemswith_tracebackrU   rz   rv   r   r   )r   rr   needed_collectorscol
finalizersexcs         r5   rv   SetupState.setup  s     NN, '+jj&6&6&8"C"*+W-WW+s!f++CF33 '9
 %S_%67Cjj((( #~t4DJJsO		 8   #'::c?1#5=N=N7O"P

3s   *B??
C;	-C66C;c                    U(       a  [        U[        5      (       a   e[        U5      (       d   eX R                  ;   d   X R                  45       eU R                  U   S   R	                  U5        g)zWAttach a finalizer to the given node.

The node must be currently active in the stack.
r   N)r   r  callabler(  rP   )r   	finalizerr   s      r5   addfinalizerSetupState.addfinalizer  sb    
 JtU3333	""""zz!5D**#55!

4""9-r7   c           	        U=(       a    UR                  5       =(       d    / n/ nU R                  (       a  [        U R                  R                  5       5      US[	        U R                  5       :X  a  OU R                  R                  5       u  nu  pV/ nU(       a!  UR                  5       n U" 5         U(       a  M!  [	        U5      S:X  a  UR                  U5        O-U(       a&  SU< 3n
UR                  [        XSSS2   5      5        U R                  (       a  M  [	        U5      S:X  a  US   eU(       a  [        SUSSS2   5      eUc  U R                  (       a   egg! [         a  n	UR                  U	5         Sn	A	NSn	A	ff = f)zTeardown the current stack up until reaching nodes that nextitem
also descends from.

When nextitem is None (meaning we're at the last item), the entire
stack is torn down.
Nr   zerrors while tearing down r   zerrors during test teardown)r+  r(  r  keysrU   popitemr   r   rP   extendr!   )r   rm   r.  
exceptionsr   r0  _these_exceptionsfinr   msgs              r5   rh   SetupState.teardown_exact  sY    &>(*<*<*>E2*,
jjDJJOO%&*;<Mc$**o*NN$(JJ$6$6$8!D/:! nn&/E * #$)!!"23!24(;!!"4S4R4:P"QR! jjj$ z?aQ-$%BJtQStDTUUzz!>z  $ /$++A../s   -E# #
F-FFr'  N)r   r   rr   r   r   r   )r5  zCallable[[], object]r   r   r   r   )rm   Item | Noner   r   )
r   r   r   r   r   r   rv   r6  rh   r  r   r7   r5   rb   rb     s    =~
*. "r7   rb   c                    U R                   nUR                  U S9  UR                  U S9nUR                  R	                  SS 5      nU(       a   [        X25      (       a  UR                  XUS9  U$ )Nr  ry   r   )rn   pytest_collectstartr$  __dict__r   r   r   )r  rn   r]   ry   s       r5   collect_one_noderH  =  sk    OOE		299I9NC<<FD)D+D66''Y#'NJr7   )r3   r   r   r   )rX   r#   r   r   )re   r"   r   r   )rr   r   rm   rD  r   r   )TN)rr   r   r   r   rm   rD  r   zlist[TestReport]rC  )rr   r   rm   rD  r   r   )rr   r   rV   z+Literal['setup', 'call', 'teardown'] | Noner   r   )r   r   r   ztuple[str, str, str] | None)T)rr   r   rV   z$Literal['setup', 'call', 'teardown']r   r   r   r   )rH   r   r   ztuple[type[BaseException], ...])ry   zCallInfo[object]r   r   r   r   )rr   r   ry   zCallInfo[None]r   r   )r  r   r   r   )Ir   
__future__r   r   collections.abcr   dataclassesr   r   typestypingr   r   r   r   r	   r
   rH   r   r   r   r   r   r   _pytestr   _pytest._code.coder   r   r   _pytest.config.argparsingr   _pytest.deprecatedr   _pytest.nodesr   r   r   r   _pytest.outcomesr   r   r   r   r   exceptiongroupr!   _pytest.mainr"   _pytest.terminalr#   r6   r`   rf   ri   rs   rp   r   r   r   r   r   r   r|   r   r   r   	dataclassr   r   r$  rb   rH  r   r7   r5   <module>rX     s   9 " 
 $  	 
           % "   1 , + , - # #   ! - $ ) g1$1* KF'- ;?
,78	)
0)!
!A!	!"	" IM
:AE4 )t
, XIww XI  XIv50fK" K"\r7   