Ë
    æØjj  ã                  ó”  — U d 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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	Z"de#d<   d	Z$de#d<   d	Z%de#d<   dZ&dZ'de#d<   d Z(d!e#d"<   e'e(fZ)d)d#„Z*d*d$„Z+d+d%„Z,d,d&„Z-d-d'„Z.	 	 	 	 	 	 	 	 	 	 	 	 	 	 d.d(„Z/y	)/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                óÊ   — t        | j                  t        «      «      }|xdk(  r |S xdk(  r |S  	 dj                  d„ t        D «       «      }t        t        › d|› d|›�«      ‚)Nr   r   z, c              3  ó2   K  — | ]  }t        |«      –— Œ y ­w©N)Úrepr)Ú.0Úchoices     úX/opt/eval-harness/bench_task/venv/lib/python3.12/site-packages/_pytest/assertion/util.pyú	<genexpr>z0get_assertion_text_diff_style.<locals>.<genexpr>8   s   è ø€ ò  Ø!'”�V—ñ ùs   ‚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ð àØ—i‘iñ  Ü+Lô ó ˆGô Ü0Ð1Ð1AÀ'ÀÈ&ÐQVÐPYÐZóð ó    c                ó   — t        | «       y r    )r.   )r+   s    r$   Ú"validate_assertion_text_diff_styler1   @   s
   € Ü! &Õ)r/   c                óP   — t        | «      }t        |«      }dj                  |«      S )aŠ  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_explanationr9   D   s'   € ô ˜{Ó+€EÜ˜5Ó!€FØ�9‰9�VÓÐr/   c                ó¦   — | xs dj                  d«      }|d   g}|dd D ]-  }|r|d   dv r|j                  |«       Œ|dxx   d|z   z  cc<   Œ/ |S )	zãReturn 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.
    Ú r3   r   é   N)ú{ú}ú~ú>éÿÿÿÿz\n)ÚsplitÚappend)r6   Ú	raw_linesr7   Úvaluess       r$   r4   r4   S   sm   € ð Ò" ×)Ñ)¨$Ó/€IØ�q‰\ˆN€EØ˜A˜B�-ò (ˆÙ�f˜Q‘iÐ#7Ñ7Ø�L‰L˜Õ à�"‹I˜ ™Ñ'ŒIð	(ð
 €Lr/   c                ó¤  — t        | dd «      }dg}dg}| dd D �]"  }|j                  d«      ro|d   rd}nd}|j                  t        |«      «       |dxx   dz  cc<   |j                  d«       |j                  dd	t        |«      dz
  z  z   |z   |dd z   «       Œ„|j                  d
«      r4|j	                  «        |j	                  «        ||d   xx   |dd z  cc<   ŒÉ|d   dv sJ ‚|dxx   dz  cc<   |j                  d«      rt        |«      nt        |«      dz
  }|j                  d	|z  |dd z   «       �Œ% t        |«      dk(  sJ ‚|S )a  Format 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=   rA   zand   zwhere z +z  r>   )r?   r@   r?   )ÚlistÚ
startswithrC   ÚlenÚpop)r7   r8   ÚstackÚstackcntÚlineÚsÚindents          r$   r5   r5   d   sR  € ô �%˜˜�)‹_€FØˆC€EØˆs€HØ�a�b�	ó 4ˆØ�?‰?˜3ÔØ˜Š|Ø‘à�Ø�L‰Lœ˜V›Ô%Ø�R‹L˜AÑ‹LØ�O‰O˜AÔØ�M‰M˜$ ¬¨U«°a©Ñ!8Ñ8¸1Ñ<¸tÀAÀB¸xÑGÕHØ�_‰_˜SÔ!Ø�I‰IŒKØ�L‰LŒNØ�5˜‘9Ó  a b Ñ)Ôà˜‘7˜jÑ(Ð(Ð(Ø�"‹I˜‰N‹IØ#'§?¡?°3Ô#7”S˜”Z¼SÀ»ZÈ!¹^ˆFØ�M‰M˜$ ™-¨$¨q¨r¨(Ñ2Ö3ð%4ô& ˆu‹:˜Š?Ðˆ?Ø€Mr/   c             #  óB  K  — t        |t        «      xr+ t        |t        «      xr t        d|«      t        d|«      k(  }|dkD  rt        ||¬«      }t        ||¬«      }n0dt	        | «      z
  dz
  dz  }	t        ||	|¬«      }t        ||	|¬«      }|› d| › d|› �}
	 | dk(  rt        |||||«      }n`| d	k(  r$t        |«      rt        |«      rt        |||«      }n7| d
v r(t        |«      rt        |«      rt        |    ||||«      }nt        d«      }d}|D ]  }|s|
–— |dk7  rd–— d}|–— Œ y# t        j                  $ r ‚ t        $ rQ t        j                   j"                  j%                  «       j'                  «       }s
|
–— d–— d}d|› d�–— d–— Y yw xY w­w)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_asciiéA   é   )ÚmaxsizerR   ú z==znot in>   ú!=ú<=ú>=ú<r@   © Fr;   Tz<(pytest_assertion plugin: representation of details failed: ú.z+ Probably an object has a faulty __repr__.)N)Ú
isinstancer&   r   r   rI   r
   r   r   r   r   r   Úiterr	   ÚExitÚ	ExceptionÚ_pytestÚ_codeÚExceptionInfoÚfrom_currentÚ_getreprcrash)ÚopÚleftÚrightÚverboseÚhighlighterr   rR   Ú	left_reprÚ
right_reprrU   ÚsummaryÚsourceÚsummary_yieldedrM   Ú
repr_crashs                  r$   Úassertrepr_comparerq   ‡   sÎ  è ø€ ô. 	�4œÓò 	>Ü�uœcÓ"ò	>ä�e˜TÓ"¤i°°uÓ&=Ñ=ð ð �‚{Ü& t°yÔAˆ	Ü'¨¸ÔC‰
ð
 ”c˜"“gÑ Ñ!Øñˆô ˜T¨7¸iÔHˆ	Ü˜e¨WÀ	ÔJˆ
à�˜1˜R˜D  * Ð.€Gð%<Ø�Š:Ü$ØØØØØ)ó‰Fð �8Š^¤ t¤´¸´Ü   u¨gÓ6‰FØÐ/Ñ/´E¸$´KÄEÈ%ÄLÜ-¨bÑ1°$¸¸{ÈGÓT‰Fä˜"“XˆFð  ˆØò 	ˆDÙ"Ø’Ø˜2’:Ø’HØ"&�Ø‹Jñ	øô �=‰=ò ØÜò 	<Ü—]‘]×0Ñ0×=Ñ=Ó?×MÑMÓOˆ
ÙØŠMØŠHØ"ˆOàJÈ:È,ÐVWÐXò	
ð <Ô;ð	<üs,   ‚BFÂBD/ Ä.FÄ/A*FÆFÆFÆF)r+   r   Úreturnr   )r+   r   rr   ÚNone)r6   r&   rr   r&   )r6   r&   rr   ú	list[str])r7   zSequence[str]rr   rt   )rf   r&   rg   Úobjectrh   ru   ri   Úintrj   r   r   r   rr   zIterator[str])0Ú__doc__Ú
__future__r   Úcollections.abcr   r   r   Útypingr   Úunicodedatar   ra   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.   r1   r9   r4   r5   rq   r[   r/   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<r/   