
    עiZ                       d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlZd dlm	Z	 d dl
Z
d dlmZ d dlZd d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dl m!Z! d dl"m#Z# d dl$m%Z% d dl$m&Z& d dl'm(Z( d dl'm)Z) ejT                  d k  rd d!l+m,Z, erd d"l-m.Z. d d#l/m0Z0 d$ Z1 G d% d&      Z2	 	 	 	 	 	 d4d'Z3	 	 	 	 	 	 d5d(Z4	 	 	 	 	 	 d6d)Z5 G d* d+e2      Z6e G d, d-e2             Z7 G d. d/e      Z8	 	 	 	 d7d0Z9	 	 	 	 d8d1Z:d9d2Z;d:d3Z<y);    )annotations)Iterable)Iterator)Mapping)SequenceN)StringIO)pprint)Any)cast)final)Literal)NoReturn)TYPE_CHECKING)ExceptionChainRepr)ExceptionInfo)ExceptionRepr)	ReprEntry)ReprEntryNative)ReprExceptionInfoReprFileLocation)ReprFuncArgs)
ReprLocalsReprTraceback)TerminalRepr)TerminalWriter)Config)	Collector)Item)fail)skip)      )BaseExceptionGroup)Self)CallInfoc                    	 | j                   S # t        $ rJ | j                  } dj                  |d   d d  }dj                  |d   |d   ||d         x| _         }|cY S w xY w)Nz{}.{}.{}version_infor#   z[{}] {} -- Python {} {}idsysplatform
executable)_workerinfocacheAttributeError
workerinfoformat)nodedverss       P/sites/domain-asset-master/.venv/lib/python3.12/site-packages/_pytest/reports.pygetworkerinfoliner6   1   s    $$$ OOj>!22A!67$=$D$DdGQ}%sAlO%
 	
 s    AA! A!c                  P   e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   ded<   ddZerd dZd!dZd"dZe	d#d       Z
e	d#d       Ze	d#d       Ze	d#d       Ze	d$d       Ze	d$d       Ze	d$d       Ze	d#d       Ze	d$d       Ze	d%d       Z	 	 	 	 	 	 d&dZd'dZed(d       Zy))
BaseReport
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                :    | j                   j                  |       y N)__dict__update)selfkws     r5   __init__zBaseReport.__init__G   s    R     c                     y rE    )rH   keys     r5   __getattr__zBaseReport.__getattr__L   s    rK   c                B   t        | d      r(t        | j                        }|r|j                  |       | j                  }|y t        |d      r"t        t        |      }|j                  |       y 	 t        |      }|j                  |       y # t        $ r d}Y w xY w)Nr1   
toterminalz<unprintable longrepr>)
hasattrr6   r1   liner>   r   r   rQ   r@   UnicodeEncodeError)rH   outworker_infor>   longrepr_terminalr4   s         r5   rQ   zBaseReport.toterminalN   s    4 +DII6K%==8\* $\8 <((--M HHQK & -,-s   3B BBc              #  d   K   | j                   D ]  \  }}|j                  |      s||f  y wrE   )r?   
startswith)rH   prefixnamecontents       r5   get_sectionszBaseReport.get_sectionsb   s3     !]] 	&MD'v&go%	&s   $0	0c                    t               }t        |      }d|_        | j                  |       |j	                         }|j                         S )zRead-only property that returns the full string representation of
        ``longrepr``.

        .. versionadded:: 3.0
        F)r   r   	hasmarkuprQ   getvaluestrip)rH   filetwexcs       r5   longreprtextzBaseReport.longreprtextg   s?     zD!mmoyy{rK   c                P    dj                  d | j                  d      D              S )z_Return captured log lines, if log capturing is enabled.

        .. versionadded:: 3.5
        
c              3  &   K   | ]	  \  }}|  y wrE   rM   .0rZ   r\   s      r5   	<genexpr>z$BaseReport.caplog.<locals>.<genexpr>{   s      
)G
   zCaptured logjoinr]   rH   s    r5   caplogzBaseReport.caplogu   s-     yy 
-1->->~-N
 
 	
rK   c                P    dj                  d | j                  d      D              S )zbReturn captured text from stdout, if capturing is enabled.

        .. versionadded:: 3.0
         c              3  &   K   | ]	  \  }}|  y wrE   rM   ri   s      r5   rk   z'BaseReport.capstdout.<locals>.<genexpr>         
)G
rl   zCaptured stdoutrm   ro   s    r5   	capstdoutzBaseReport.capstdout   .     ww 
-1->->?P-Q
 
 	
rK   c                P    dj                  d | j                  d      D              S )zbReturn captured text from stderr, if capturing is enabled.

        .. versionadded:: 3.0
        rr   c              3  &   K   | ]	  \  }}|  y wrE   rM   ri   s      r5   rk   z'BaseReport.capstderr.<locals>.<genexpr>   rt   rl   zCaptured stderrrm   ro   s    r5   	capstderrzBaseReport.capstderr   rv   rK   c                     | j                   dk(  S )zWhether the outcome is passed.passedrC   ro   s    r5   r{   zBaseReport.passed        ||x''rK   c                     | j                   dk(  S )zWhether the outcome is failed.failedr|   ro   s    r5   r   zBaseReport.failed   r}   rK   c                     | j                   dk(  S )zWhether the outcome is skipped.skippedr|   ro   s    r5   r   zBaseReport.skipped   s     ||y((rK   c                >    | j                   j                  d      d   S )z3The path portion of the reported node, as a string.z::r   )rA   splitro   s    r5   fspathzBaseReport.fspath   s     {{  &q))rK   c                     y)a6  **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   ro   s    r5   count_towards_summaryz BaseReport.count_towards_summary   s     rK   c                @    | j                   | j                   \  }}}|S y)a  **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<   )rH   _fspath_linenodomains       r5   	head_linezBaseReport.head_line   s&      ==$'+}}$GWfMrK   c                   |j                   j                  | |      \  }}}t        |t              r||fS t        |t              r7t        |      dk(  r)|\  }}t        |t              rt        |t              r||fS t        d|d       y )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!   )rH   r   default_markup	_category_shortverbosewordmarkups           r5   _get_verbose_word_with_markupz(BaseReport._get_verbose_word_with_markup   s     &,[[%I%I &J &
"	67 gs#N**gx(S\Q->"LD&$$FG)DV|#))0 4,,	
rK   c                    t        |       S )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_jsonro   s    r5   _to_jsonzBaseReport._to_json   s     t$$rK   c                (    t        |      } | di |S )a  Create 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      r5   
_from_jsonzBaseReport._from_json   s     **5}V}rK   N)rI   r
   returnNone)rN   r@   r   r
   rU   r   r   r   )rZ   r@   r   zIterator[tuple[str, str]]r   r@   )r   bool)r   r9   )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____annotations__rJ   r   rO   rQ   r]   propertyre   rp   ru   ry   r{   r   r   r   r   r   r   r   classmethodr   rM   rK   r5   r8   r8   =   s>   
00W $#K33! 3(&
   
 
 
 
 
 
 ( ( ( ( ) ) * * 	 	  (

.@
	'
*% 
 
rK   r8   c                    d}t               }t        d|       t        d|  |       t        d| |       t        ||       t        d| |       t        d|       t        |j                               )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	   RuntimeErrorr`   )	type_namereport_classr   urlr   s        r5   _report_unserialization_failurer      su     8CZF
9V$
9)EfU
]<.)&9
:f%
'u-f=
9V$
v(
))rK   c                    |j                   dk(  r| j                  |      }|S | j                  || j                  j	                  dd            }|S )Ncalltbstyleauto)style)r:   repr_failure_repr_failure_pyr   	getoption)itemr   excinfor>   s       r5   _format_failed_longreprr     s[     yyF$$W- O ((4;;00FC ) 
 OrK   c                H   |j                         }|J d       t        d |j                  j                  D              r7| j	                         d d \  }}|J t        j                  |      |dz   f}d}n-t        |j                        |j                  f}|j                  }g }|j                  j                  D ]G  }t        |dd       xs |j                  r|j                  d   nd }	|	s2|	|vs7|j                  |	       I |rdj                  |      n|}
g ||
}|S )	N=There should always be a traceback entry for skipping a test.c              3  6   K   | ]  }t        |d d        yw)_use_item_locationFN)getattr)rj   r"   s     r5   rk   z?_format_exception_group_all_skipped_longrepr.<locals>.<genexpr>  s      7;*E2s   r      r   msgr   z; )_getreprcrashallvalue
exceptions
reportinfoosr   r@   pathlinenomessager   argsappendrn   )r   r   rr   rS   locdefault_msgmsgs	exceptionmreasonr>   s               r5   ,_format_exception_group_all_skipped_longreprr     s+    	A= G=  ?F}}?W?W  __&r*
dyyq)166{AHH%ii D]]-- 	Iud+ 
!*INN1T 	
 $KKN !%TYYt_+F~f~HOrK   c                  |    e Zd ZU dZdZded<   	 	 	 	 	 d		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
dZddZedd       Z	y)
TestReportzBasic test report object (also used for setup and teardown calls if
    they fail).

    Reports can contain arbitrary extra attributes.
    Fr@   wasxfailNc                    || _         || _        || _        || _        || _        || _        t        |xs g       | _        t        |      | _        || _	        |	| _
        |
| _        | j                  j                  |       y rE   )rA   r<   keywordsrC   r>   r:   listuser_propertiesr?   durationstartstoprF   rG   )rH   rA   r<   r   rC   r>   r:   r?   r   r   r   r   extras                r5   rJ   zTestReport.__init__>  s    (  6> ,4  ! ;?	  $O$9r: X  ( "
	U#rK   c           	         d| j                   j                   d| j                  d| j                  d| j                  d	S )N< z when=	 outcome=>)	__class__r   rA   r:   rC   ro   s    r5   __repr__zTestReport.__repr__|  s?    4>>**+1T[[O6$))iX\XdXdWgghiirK   c                n   |j                   }|dk7  sJ |j                  }|j                  }|j                  }|j                  D ci c]  }|d }}|j
                  }	g }
|j
                  sd}d}nat        |	t              sd}|	}nKt        |	j                  t        j                        rd}|	j                         }|J d       |	j                  j                  r@|j                         dd \  }}|J t        j                  |      |dz   |j                   f}nt#        |j$                        |j&                  |j                   f}nt        |	j                  t(              r`|	j                  j+                  t        j                        d   4d}t-        t        t(        t.        t(        z        |	      }	t1        ||	      }nd}t3        |||	      }|j4                  D ]  \  }}}|
j7                  d	| d
| |f       !  | |j8                  |j:                  |||||
||||j<                        S c c}w )zCreate and fill a TestReport with standard item and call info.

        :param item: The item.
        :param call: The call info.
        collectr   r{   Nr   r   r   r   z	Captured r   )r   )r:   r   r   r   r   r   r   r   r   r"   	Exceptionr   r   r   r   r   r   r@   r   r   r%   r   r   BaseExceptionr   r   _report_sectionsr   rA   r<   r   )r   r   r   r:   r   r   r   xr   r   r?   rC   r>   r   r   rS   rwhenrN   r\   s                      r5   from_item_and_callzTestReport.from_item_and_call  s'    yyy   ==

yy"&--0QAqD00,,||>FG   g}5""GMM4>>:#))+} S} ==33!%!22A!6JD$+++ "		$199EH #AFFQXXqyyAHGMM+=>##DNN3A6> $!*=;M+MN 	 HgV"24wG#'#8#8 	BE3OOyQug6@A	BKKMM 00
 	
[ 1s   
H2)rM   r   r   r   N)rA   r@   r<   ztuple[str, int | None, str]r   zMapping[str, Any]rC   rB   r>   r=   r:   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   CallInfo[None]r   r   )
r   r   r   __doc____test__r   rJ   r   r   r   rM   rK   r5   r   r   1  s     H M /1?C!<$<$ .<$ $	<$
 8<$<$ 3<$ ,<$ <$ <$ <$  =!<$$ 
%<$|j E
 E
rK   r   c                  T    e Zd ZdZdZ	 d	 	 	 	 	 	 	 	 	 	 	 ddZe	 	 d	d       Zd
dZy)CollectReportzSCollection report object.

    Reports can contain arbitrary extra attributes.
    r   c                    || _         || _        || _        |xs g | _        t	        |      | _        | j                  j                  |       y rE   )rA   rC   r>   resultr   r?   rF   rG   )rH   rA   rC   r>   r   r?   r   s          r5   rJ   zCollectReport.__init__  sI       ! l XU#rK   c                4    | j                   d | j                   fS rE   )r   ro   s    r5   r<   zCollectReport.location  s     T4;;//rK   c                h    d| j                   dt        | j                         d| j                  dS )Nz<CollectReport z lenresult=r   r   )rA   r   r   rC   ro   s    r5   r   zCollectReport.__repr__  s4     {3t{{;K:LIVZVbVbUeefggrK   N)rM   )rA   r@   rC   rB   r>   r=   r   zlist[Item | Collector] | Noner?   r   r   r   )r   r;   r   )	r   r   r   r   r:   rJ   r   r<   r   rM   rK   r5   r   r     su    
 D /1$$ 8$	$ .$ ,$ 
$B 0	+0 0
hrK   r   c                      e Zd ZddZddZy)CollectErrorReprc                    || _         y rE   )r>   )rH   r   s     r5   rJ   zCollectErrorRepr.__init__  s	    rK   c                >    |j                  | j                  d       y )NT)red)rS   r>   )rH   rU   s     r5   rQ   zCollectErrorRepr.toterminal   s    D)rK   N)r   r@   r   r   r   )r   r   r   rJ   rQ   rM   rK   r5   r  r    s    *rK   r  c                    t        | t        t        z        r+| j                         }| j                  j
                  |d<   |S y )N$report_type)r   r   r   r   r   r   )r   datas     r5   pytest_report_to_serializabler	    s=     &*}45 %//88^rK   c                    d| v rS| d   dk(  rt         j                  |       S | d   dk(  rt        j                  |       S J dj                  | d                y )Nr  r   r   z(Unknown report_type unserialize data: {})r   r   r   r0   )r  s    r5   pytest_report_from_serializabler    so     </((...!_4 ++D11	
@GG 
 	
u rK   c                   	 	 	 	 dddfd	 	 	 	 dddfd}| j                   j                         }t        | j                  d      rQt        | j                  d      r"t        | j                  d      r ||       |d<   n(t	        | j                        |d<   n| j                  |d<   |D ]F  }t        ||   t        j                        rt        j                  ||         ||<   <|d	k(  sBd
||<   H |S )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                    t        j                  |       }|j                         D ]*  \  }}t        |d      st        j                  |      ||<   , t	        |       j
                  |d}|S )NrF   )typer  )dataclassesasdictitemsrR   r  r   )entryr  rN   r   
entry_datas        r5   serialize_repr_entryz-_report_to_json.<locals>.serialize_repr_entry$  sg     !!%(**, 	6JCuj)'..u5S		6 #5k22DA
rK   reprtracebackc                    t        j                  |       }| j                  D cg c]
  } |       c}|d<   |S c c}w )Nreprentries)r  r  r  )r  r   r   r  s      r5   serialize_repr_tracebackz1_report_to_json.<locals>.serialize_repr_traceback.  sE    ##M2-:-F-F!
() #!
} !
s   <	reprcrashc                2    | t        j                  |       S y rE   )r  r  )r  s    r5   serialize_repr_crashz-_report_to_json.<locals>.serialize_repr_crash5  s      %%i00rK   c                `   | j                   J t        t        | j                         } |j                         |j                        |j
                  d}t        |t              r?g |d<   |j                  D ])  \  }}}|d   j                   |       |      |f       + |S d |d<   |S )N)r  r  r?   chain)
r>   r   r   r  r  r?   r   r   r  r   )repr>   r   repr_traceback
repr_crashdescriptionr  r  s         r5   serialize_exception_longreprz5_report_to_json.<locals>.serialize_exception_longrepr=  s    ||'''s||4-h.@.@A5h6L6LM ))"

 h 23 F7O;C>> 7
Kw&&0@,Z8#  #F7OrK   rQ   r>   r   N)r  zReprEntry | ReprEntryNativer   r   )r  r   r   r   )r  zReprFileLocation | Noner   dict[str, Any] | None)r  r8   r   r   )	rF   copyrR   r>   r@   r   r   PathLiker   )r   r"  r2   r[   r  r  r  s       @@@r5   r   r     s    *	*	. 	Av-6??O4OO[:
 9@AjM0AjM* agr{{+ii$(AdGXAdG	
 HrK   c                n     fdfd}d
d} d   rd d   v rd d   v r | d   d         } | d   d         } d   d   r?g } d   d   D ]&  \  }}}|j                   ||       ||      |f       ( t        |      }	nt        ||      }	 d   d	   D ]  }
 |	j                  |
   |	 d<    S )zReturn **kwargs that can be used to construct a TestReport or
    CollectReport instance.

    This was originally the serialize_report() function from xdist (ca03269).
    c                &   | d   }| d   }|dk(  rZd }d }d }|d   rt        di |d   }|d   rt        di |d   }|d   rt        |d   d         }t        |d   ||||d   	      }|S |d
k(  rt	        |d         }|S t        |t               S )Nr  r  r   reprfuncargsreprfileloc
reprlocalslinesr   )r+  r(  r*  r)  r   r   rM   )r   r   r   r   r   r   r   )r  r  
entry_typer(  r)  r*  	reprentryr   s          r5   deserialize_repr_entryz8_report_kwargs_from_json.<locals>.deserialize_repr_entrym  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                \    | d   D cg c]
  } |       c}| d<   t        di | S c c}w )Nr  rM   r   )repr_traceback_dictr   r.  s     r5   deserialize_repr_tracebackz<_report_kwargs_from_json.<locals>.deserialize_repr_traceback  s?    /B=/Q.
*+"1%.
M* 3233.
s   )c                    | t        di | S y )NrM   r   )repr_crash_dicts    r5   deserialize_repr_crashz8_report_kwargs_from_json.<locals>.deserialize_repr_crash  s    &#6o66rK   r>   r  r  r  )r  r  r?   )r3  r#  )r   r   r   
addsection)r   r1  r4  r  r  r  repr_traceback_datarepr_crash_datar!  exception_infosectionr.  s   `          @r5   r   r   f  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XFN /+#N
 "*-j9 	0G%N%%w/	0!/
:rK   )r   r@   r   ztype[BaseReport]r   r   )r   r    r   r   r   zExceptionInfo[BaseException])r   r    r   zEExceptionInfo[BaseExceptionGroup[BaseException | BaseExceptionGroup]]r   ztuple[str, int, str])r   zCollectReport | TestReportr   r#  )r  r   r   z!CollectReport | TestReport | None)r   r8   r   r   )r   r   r   r   )=
__future__r   collections.abcr   r   r   r   r  ior   r   r	   systypingr
   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"   r)   exceptiongroupr%   typing_extensionsr&   _pytest.runnerr'   r6   r8   r   r   r   r   r   r  r	  r  r   r   rM   rK   r5   <module>rG     sc   " $ $ # $   	  
        1 , , ( . 0 / + ) , + & ! #  ! ! g1 &'	u up**"2**


$
/K

R BT
 T
n 0hJ 0h 0hf*| *&
&FRPrK   