
    9[gSS                    L   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 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rd d l(m)Z) d d!l*m+Z+ d" Z, G d# d$      Z-	 	 	 	 	 	 d0d%Z.e
 G d& d'e-             Z/e
 G d( d)e-             Z0 G d* d+e      Z1	 	 	 	 d1d,Z2	 	 	 	 d2d-Z3d3d.Z4d4d/Z5y)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                    	 | 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_info   z[{}] {} -- Python {} {}idsysplatform
executable)_workerinfocacheAttributeError
workerinfoformat)nodedverss       J/var/www/html/bid-api/venv/lib/python3.12/site-packages/_pytest/reports.pygetworkerinfoliner4   ,   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     r3   __init__zBaseReport.__init__B   s    R     c                     y rC    )rF   keys     r3   __getattr__zBaseReport.__getattr__G   s    rI   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)Nr/   
toterminalz<unprintable longrepr>)
hasattrr4   r/   liner<   r   r   rO   r>   UnicodeEncodeError)rF   outworker_infor<   longrepr_terminalr2   s         r3   rO   zBaseReport.toterminalI   s    4 +DII6K%==8\* $\8 <((--M HHQK & -,-s   3B BBc              #  d   K   | j                   D ]  \  }}|j                  |      s||f  y wrC   )r=   
startswith)rF   prefixnamecontents       r3   get_sectionszBaseReport.get_sections]   s.     !]]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   	hasmarkuprO   getvaluestrip)rF   filetwexcs       r3   longreprtextzBaseReport.longreprtextb   s?     zD!mmoyy{rI   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rC   rK   .0rX   rZ   s      r3   	<genexpr>z$BaseReport.caplog.<locals>.<genexpr>v   s      
-N)G-N   zCaptured logjoinr[   rF   s    r3   caplogzBaseReport.caplogp   s-     yy 
-1->->~-N
 
 	
rI   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rC   rK   rg   s      r3   ri   z'BaseReport.capstdout.<locals>.<genexpr>         
-Q)G-Qrj   zCaptured stdoutrk   rm   s    r3   	capstdoutzBaseReport.capstdoutz   .     ww 
-1->->?P-Q
 
 	
rI   c                P    dj                  d | j                  d      D              S )zbReturn captured text from stderr, if capturing is enabled.

        .. versionadded:: 3.0
        rp   c              3  &   K   | ]	  \  }}|  y wrC   rK   rg   s      r3   ri   z'BaseReport.capstderr.<locals>.<genexpr>   rr   rj   zCaptured stderrrk   rm   s    r3   	capstderrzBaseReport.capstderr   rt   rI   c                     | j                   dk(  S )zWhether the outcome is passed.passedrA   rm   s    r3   ry   zBaseReport.passed        ||x''rI   c                     | j                   dk(  S )zWhether the outcome is failed.failedrz   rm   s    r3   r}   zBaseReport.failed   r{   rI   c                     | j                   dk(  S )zWhether the outcome is skipped.skippedrz   rm   s    r3   r   zBaseReport.skipped   s     ||y((rI   c                >    | j                   j                  d      d   S )z3The path portion of the reported node, as a string.z::r   )r?   splitrm   s    r3   fspathzBaseReport.fspath   s     {{  &q))rI   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.
        TrK   rm   s    r3   count_towards_summaryz BaseReport.count_towards_summary   s     rI   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:   )rF   r   linenodomains       r3   	head_linezBaseReport.head_line   s&      ==$%)]]"FFFMrI   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!   )rF   r   default_markup	_category_shortverbosewordmarkups           r3   _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,,	
rI   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_jsonrm   s    r3   _to_jsonzBaseReport._to_json   s     t$$rI   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.
        rK   )_report_kwargs_from_json)cls
reportdictkwargss      r3   
_from_jsonzBaseReport._from_json   s     **5}V}rI   N)rG   r   returnNone)rL   r>   r   r   rS   r   r   r   )rX   r>   r   zIterator[tuple[str, str]]r   r>   )r   bool)r   r7   )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__rH   r   rM   rO   r[   propertyrc   rn   rs   rw   ry   r}   r   r   r   r   r   r   classmethodr   rK   rI   r3   r6   r6   8   s>   
00W $#K33! 3(&
   
 
 
 
 
 
 ( ( ( ( ) ) * * 	 	  (

.@
	'
*% 
 
rI   r6   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        r3   _report_unserialization_failurer      su     8CZF
9V$
9)EfU
]<.)&9
:f%
'u-f=
9V$
v(
))rI   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 rC   )r?   r:   keywordsrA   r<   r8   listuser_propertiesr=   durationstartstoprD   rE   )rF   r?   r:   r   rA   r<   r8   r=   r   r   r   r   extras                r3   rH   zTestReport.__init__  s    (  6> ,4  ! 	  $O$9r: X  ( "
	U#rI   c           	         d| j                   j                   d| j                  d| j                  d| j                  d	S )N< z when=	 outcome=>)	__class__r   r?   r8   rA   rm   s    r3   __repr__zTestReport.__repr__I  s?    4>>**+1T[[O6$))iX\XdXdWgghiirI   c                   |j                   }|dk7  sJ |j                  }|j                  }|j                  }|j                  D ci c]  }|d }}|j
                  }	g }
|j
                  sd}d}n(t        |	t              sd}|	}nt        |	j                  t        j                        rd}|	j                         }|J d       |	j                  j                  r@|j                         dd \  }}|J t        j                  |      |dz   |j                   f}n}t#        |j$                        |j&                  |j                   f}nPd}|j                   d	k(  r|j)                  |	      }n-|j+                  |	|j,                  j/                  d
d            }|j0                  D ]  \  }}}|
j3                  d| d| |f       !  | |j4                  |j6                  |||||
||||j8                        S c c}w )zCreate and fill a TestReport with standard item and call info.

        :param item: The item.
        :param call: The call info.
        collect   ry   Nr}   r   z=There should always be a traceback entry for skipping a test.r   calltbstyleauto)stylez	Captured r   )r   )r8   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   r8   r   r   r   xr   r   r=   rA   r<   rr   rQ   rwhenrL   rZ   s                      r3   from_item_and_callzTestReport.from_item_and_callL  s    yyy   ==

yy"&--0-QAqD-0,,||>FG   g}5""GMM4>>:#))+MSRS!==33!%!22A!6JD$+++!yyq!))CH #AFFQXXqyyAH"99&#009H#44t{{'<'<Y'O  5  H $(#8#8E3OOyQug6@A $9KKMM 00
 	
M 1s   
G9)rK   r   r   r   N)r?   r>   r:   ztuple[str, int | None, str]r   zMapping[str, Any]rA   r@   r<   r;   r8   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   __doc____test__r   rH   r   r   r   rK   rI   r3   r   r      s     H M /1?C!<$<$ .<$ $	<$
 8<$<$ 3<$ ,<$ <$ <$ <$  =!<$$ 
%<$|j >
 >
rI   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 rC   )r?   rA   r<   resultr   r=   rD   rE   )rF   r?   rA   r<   r   r=   r   s          r3   rH   zCollectReport.__init__  sI       ! l XU#rI   c                4    | j                   d | j                   fS rC   )r   rm   s    r3   r:   zCollectReport.location  s     T4;;//rI   c                h    d| j                   dt        | j                         d| j                  dS )Nz<CollectReport z lenresult=r   r   )r?   r   r   rA   rm   s    r3   r   zCollectReport.__repr__  s4     {3t{{;K:LIVZVbVbUeefggrI   N)rK   )r?   r>   rA   r@   r<   r;   r   zlist[Item | Collector] | Noner=   r   r   r   )r   r9   r   )	r   r   r   r   r8   rH   r   r:   r   rK   rI   r3   r   r     su    
 D /1$$ 8$	$ .$ ,$ 
$B 0	+0 0
hrI   r   c                      e Zd ZddZddZy)CollectErrorReprc                    || _         y rC   )r<   )rF   msgs     r3   rH   zCollectErrorRepr.__init__  s	    rI   c                >    |j                  | j                  d       y )NT)red)rQ   r<   )rF   rS   s     r3   rO   zCollectErrorRepr.toterminal  s    D)rI   N)r   r>   r   r   r   )r   r   r   rH   rO   rK   rI   r3   r   r     s    *rI   r   c                    t        | t        t        f      r+| j                         }| j                  j
                  |d<   |S y )N$report_type)r   r   r   r   r   r   )r   datas     r3   pytest_report_to_serializabler     s=     &:}56 %//88^rI   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   r.   )r   s    r3   pytest_report_from_serializabler     so     </((...!_4 ++D11	
@GG 
 	
u rI   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 )NrD   )typer   )dataclassesasdictitemsrP   r   r   )entryr   rL   r   
entry_datas        r3   serialize_repr_entryz-_report_to_json.<locals>.serialize_repr_entry  sb     !!%(**,JCuj)'..u5S	 ' #5k22DA
rI   reprtracebackc                    t        j                  |       }| j                  D cg c]
  } |       c}|d<   |S c c}w )Nreprentries)r   r   r  )r   r   r   r   s      r3   serialize_repr_tracebackz1_report_to_json.<locals>.serialize_repr_traceback  sJ    ##M2-:-F-F!
-F #-F!
} !
s   <	reprcrashc                2    | t        j                  |       S y rC   )r   r   )r  s    r3   serialize_repr_crashz-_report_to_json.<locals>.serialize_repr_crash  s      %%i00rI   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         r3   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# <J  #F7OrI   rO   r<   r   N)r   zReprEntry | ReprEntryNativer   r   )r   r   r   r   )r  zReprFileLocation | Noner   dict[str, Any] | None)r  r6   r   r   )	rD   copyrP   r<   r>   r   r   PathLiker   )r   r  r0   rY   r  r   r  s       @@@r3   r   r     s    *	*	. 	Av-6??O4OO[:
 9@AjM0AjM*agr{{+ii$(AdGXAdG	 
 HrI   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   rK   )r   r   r   r   r   r   r   )r   r   
entry_typer  r  r  	reprentryr   s          r3   deserialize_repr_entryz8_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rI   c                \    | d   D cg c]
  } |       c}| d<   t        di | S c c}w )Nr  rK   r   )repr_traceback_dictr   r  s     r3   deserialize_repr_tracebackz<_report_kwargs_from_json.<locals>.deserialize_repr_tracebackN  sD    /B=/Q.
/Q!"1%/Q.
M* 3233.
s   )c                    | t        di | S y )NrK   r   )repr_crash_dicts    r3   deserialize_repr_crashz8_report_kwargs_from_json.<locals>.deserialize_repr_crashT  s    &#6o66rI   r<   r  r   r  )r   r  r=   )r  r  )r   r   r   
addsection)r   r  r  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%N%%w/ :!/
:rI   )r   r>   r   ztype[BaseReport]r   r   )r   zCollectReport | TestReportr   r  )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   rK   rI   r3   <module>r.     s    "   	             1 , , ( . 0 / + ) , + & ! #  ! ! &'	u up**"2** L
 L
 L
^ 0hJ 0h 0hf*| *&
&FRPrI   