
    ~/j                       % S 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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	r"S\#S'   S	r$S\#S'   S	r%S\#S'   Sr&Sr'S\#S'   S r(S!\#S"'   \'\(4r)S)S# jr*S*S$ jr+S+S% jr,S,S& jr-S-S' jr.              S.S( jr/g	)/z"Utilities for assertion debugging.    )annotations)Callable)Iterator)Sequence)Literal)	normalize)outcomesN)saferepr)saferepr_unlimited)_compare_eq_any)SET_COMPARISON_FUNCTIONS)isset)istext)_AssertionTextDiffStyle)_HighlightFunc)_notin_text)dummy_highlighter)Config)
UsageErrorz2Callable[[str, object, object], str | None] | None_reprcomparez&Callable[[int, str, str], None] | None_assertion_passzConfig | None_configassertion_text_diff_stylendiffzLiteral['ndiff']ASSERTION_TEXT_DIFF_STYLE_NDIFFblockzLiteral['block']ASSERTION_TEXT_DIFF_STYLE_BLOCKc                    [        U R                  [        5      5      nU=S:X  a    U$ =S:X  a    U$    SR                  S [         5       5      n[        [         SU SU< 35      e)Nr   r   z, c              3  8   #    U  H  n[        U5      v   M     g 7fN)repr).0choices     U/root/lseg-credit/backend/venv/lib/python3.13/site-packages/_pytest/assertion/util.py	<genexpr>0get_assertion_text_diff_style.<locals>.<genexpr>8   s       +LV+Ls   z must be one of z; got )strgetiniASSERTION_TEXT_DIFF_STYLE_INIjoin!ASSERTION_TEXT_DIFF_STYLE_CHOICESr   )configstylechoicess      r$   get_assertion_text_diff_styler/   2   s{    ;<=E
L L ii  +L  G 011A'&QVPYZ     c                    [        U 5        g r    )r/   )r,   s    r$   "validate_assertion_text_diff_styler2   @   s
    !&)r0   c                P    [        U 5      n[        U5      nSR                  U5      $ )an  Format an explanation.

Normally all embedded newlines are escaped, however there are
three exceptions: \n{, \n} and \n~.  The first two are intended
cover nested explanations, see function and attribute explanations
for examples (.visit_Call(), visit_Attribute()).  The last one is
for when one explanation needs to span multiple lines, e.g. when
displaying diffs.

)_split_explanation_format_linesr*   )explanationlinesresults      r$   format_explanationr:   D   s'     {+E5!F99Vr0   c                    U =(       d    SR                  S5      nUS   /nUSS  H6  nU(       a  US   S;   a  UR                  U5        M&  US==   SU-   -  ss'   M8     U$ )	zReturn a list of individual lines in the explanation.

This will return a list of lines split on '\n{', '\n}' and '\n~'.
Any other newlines will be escaped and appear in the line as the
literal '\n' characters.
 r4   r      N){}~>z\n)splitappend)r7   	raw_linesr8   valuess       r$   r5   r5   S   sh     "))$/Iq\NEAB-fQi#77LL "I'I	  
 Lr0   c                   [        U SS 5      nS/nS/nU SS  GH:  nUR                  S5      (       au  US   (       a  SnOSnUR                  [        U5      5        US==   S-  ss'   UR                  S5        UR                  SS	[        U5      S-
  -  -   U-   USS -   5        M  UR                  S
5      (       a4  UR	                  5         UR	                  5         XS   ==   USS -  ss'   M  US   S;   d   eUS==   S-  ss'   UR                  S5      (       a  [        U5      O[        U5      S-
  nUR                  S	U-  USS -   5        GM=     [        U5      S:X  d   eU$ )zFormat the individual lines.

This will replace the '{', '}' and '~' characters of our mini formatting
language with the proper 'where ...', 'and ...' and ' + ...' text, taking
care of indentation along the way.

Return a list of formatted lines.
Nr=   r   r>   rB   zand   zwhere z +z  r?   )r@   rA   r@   )list
startswithrD   lenpop)r8   r9   stackstackcntlinesindents          r$   r6   r6   d   sT    %)_FCEsHab	??3|LLV%RLALOOAMM$Ua!881<tABxGH__S!!IIKLLN9ab)7j((("INI#'??3#7#7SZSZ!^FMM$-$qr(23% & u:??Mr0   c             #    #    [        U[        5      =(       a0    [        U[        5      =(       a    [        SU5      [        SU5      :H  nUS:  a  [        XS9n[        X&S9nO(S[	        U 5      -
  S-
  S-  n	[        XUS9n[        X)US9nU SU  SU 3n
 U S:X  a  [        UUUUU5      nOuU S	:X  a-  [        U5      (       a  [        U5      (       a  [        XU5      nOBU S
;   a1  [        U5      (       a!  [        U5      (       a  [        U    " XXC5      nO[        S5      nSnU H  nU(       d  U
v   US:w  a  Sv   SnUv   M      g! [        R                   a    e [         aV    [        R                   R"                  R%                  5       R'                  5       nW(       d
  U
v   Sv   SnSU S3v   Sv    gf = f7f)a  Yield specialised explanations for some operators/operands.

The first line yielded is always the summary (``left op right``);
subsequent lines are the detailed explanation. Yields nothing when no
specialised explanation applies, which lets consumers map an empty
iterator to "no explanation" without materialising anything.

The iterator is lazy on purpose: a streaming consumer can stop pulling
lines as soon as it has enough to show, so an enormous diff doesn't
have to be built in full just to be thrown away.
NFDr=   )	use_asciiA      )maxsizerS    z==znot in>   <rA   !=<=>= Fr<   Tz<(pytest_assertion plugin: representation of details failed: .z+ Probably an object has a faulty __repr__.)N)
isinstancer'   r   r   rJ   r
   r   r   r   r   r   iterr	   Exit	Exception_pytest_codeExceptionInfofrom_current_getreprcrash)opleftrightverbosehighlighterr   rS   	left_repr
right_reprrV   summarysourcesummary_yieldedrN   
repr_crashs                  r$   assertrepr_comparerr      s    . 	4 	>uc"	>eT"iu&==  {&tA	'C

 c"g! TiH	e	J
1RD*.G%<:$)F 8^t g6F//E$KKE%LL-b1${TF"XF  D"2:H"&J  ==  	<]]00==?MMO
MH"OJ:,VWX	
 <;	<s,   BF?B1E F?A1F<9F?;F<<F?)r,   r   returnr   )r,   r   rs   None)r7   r'   rs   r'   )r7   r'   rs   	list[str])r8   zSequence[str]rs   ru   )rg   r'   rh   objectri   rv   rj   intrk   r   r   r   rs   zIterator[str])0__doc__
__future__r   collections.abcr   r   r   typingr   unicodedatar   rb   r	   _pytest._code_pytest._io.safereprr
   r   _pytest.assertion._compare_anyr   _pytest.assertion._compare_setr   _pytest.assertion._guardsr   r   _pytest.assertion._typingr   r   _pytest.assertion.compare_textr   _pytest.assertion.highlightr   _pytest.configr   r   r   __annotations__r   r   r)   r   r   r+   r/   r2   r:   r5   r6   rr   r\   r0   r$   <module>r      s   ( " $ $ $  !   ) 3 : C + , = 4 6 N ! % DH@ G ;?7 >   ; 4; !1 ;4; !1 ;##% !*" FP<P<
P< P<
 P<  P<  7P< P<r0   