ó
    ùÞ j$  ã                  ó‚   • S r SSKJr  SSKJr  SSKJr  SSKJr  Sr	\	S-  r
SrSS	 jrSS
 jr        SS jrSS jrg)zÑUtilities for truncating assertion output.

Current default behaviour is to truncate assertion explanations at
terminal lines, unless running with an assertions verbosity level of at least 2 or running on CI.
é    )Úannotations)Úrunning_on_ci)ÚConfig)ÚItemé   éP   zuse '-vv' to showc                óF   • [        U5      u  p#nU(       a  [        U UUS9$ U $ )zGTruncate this assertion explanation if the given test item is eligible.)Ú	max_linesÚ	max_chars)Ú_get_truncation_parametersÚ_truncate_explanation)ÚexplanationÚitemÚshould_truncater
   r   s        ÚT/var/www/html/gaurav/venv/lib/python3.13/site-packages/_pytest/assertion/truncate.pyÚtruncate_if_requiredr      s2   € ä,FÀtÓ,LÑ)€O 	ÞÜ$ØØØñ
ð 	
ð
 Ðó    c                ó‚  • U R                   R                  S5      n[        Ub  UO[        5      nU R                   R                  S5      n[        Ub  UO[        5      nU R                   R                  [        R                  5      nUS:  =(       a    [        5       (       + nU=(       a    US:„  =(       d    US:„  nXAU4$ )zgReturn the truncation parameters related to the given item, as (should truncate, max lines, max chars).Útruncation_limit_linesÚtruncation_limit_charsé   r   )	ÚconfigÚgetiniÚintÚDEFAULT_MAX_LINESÚDEFAULT_MAX_CHARSÚget_verbosityr   ÚVERBOSITY_ASSERTIONSr   )r   r
   r   Úverboser   s        r   r   r      s¡   € ð —‘×"Ñ"Ð#;Ó<€IÜ Ñ!6‘IÔ<MÓN€Ià—‘×"Ñ"Ð#;Ó<€IÜ Ñ!6‘IÔ<MÓN€Ià�k‰k×'Ñ'¬×(CÑ(CÓD€Gà ‘k×9¬-«/Ô&9€OØ%×J¨9°q©=×+I¸IÈ¹M€Oà yÐ0Ð0r   c                óˆ  • US-   nUS:X  d  [        U 5      US-   ::  a!  US:X  d  [        S U  5       5      U::  a  U $ U nOU SU nUS:„  =(       a    [        S U 5       5      U:„  nU(       a  [        XB5      nUS==   S-  ss'   [        U 5      [        U5      -
  [        U5      -   n/ UQS	PS
U SUS:X  a  S	OS S[         3P$ )aù  Truncate given list of strings that makes up the assertion explanation.

Truncates to either max_lines, or max_chars - whichever the input reaches
first, taking the truncation explanation into account. The remaining lines
will be replaced by a usage message.

If max_chars=0, no truncation by character count is performed.
If max_lines=0, no truncation by line count is performed.

When this function is launched we know max_lines > 0 or max_chars > 0
because _get_truncation_parameters was called first.
éF   r   r   c              3  ó6   #   • U H  n[        U5      v •  M     g 7f©N©Úlen)Ú.0Úss     r   Ú	<genexpr>Ú(_truncate_explanation.<locals>.<genexpr>U   s   é € Ð =±¨A¤ Q§ ²ùó   ‚Nc              3  ó6   #   • U H  n[        U5      v •  M     g 7fr#   r$   )r&   Úes     r   r(   r)   ^   s   é € Ð6Ñ 5˜1”�A—�Ò 5ùr*   éÿÿÿÿz...Ú z...Full output truncated (z lineé   r'   z
 hidden), )r%   ÚsumÚ_truncate_by_char_countr   Ú	USAGE_MSG)Úinput_linesr
   r   Útolerable_max_charsÚtruncated_explanationÚneed_to_truncate_charÚtruncated_line_counts          r   r   r   4   s  € ð: 	�B‰ð ð �Aƒ~œ˜[Ó)¨Y¸©]Ó:Ø˜‹>œSÑ =±Ó =Ó=ÐATÓTØÐØ +Ñð !,¨J¨YÐ 7Ðð 	�A‰÷ 	MÜÑ6Ñ 5Ó6Ó6Ð9LÑLð ö Ü 7Ø!ó!
Ðð ˜"Ó Ñ&ÓäˆKÓœ3Ð4Ó5Ñ5¼Ð<QÓ8RÑRð ðØ	ðà
ðð %Ð%9Ð$:¸%Ø%¨Ó*‰2°Ð
4°J¼y¸kð	Kðð r   c                óÊ   • Sn[        U 5       H'  u  p4U[        U5      -   U:”  a    OU[        U5      -  nM)     U S W nX   nU(       a	  X-
  nUS U nUR                  U5        U$ )Nr   )Ú	enumerater%   Úappend)r3   r   Úiterated_char_countÚiterated_indexÚ
input_lineÚtruncated_resultÚ
final_lineÚfinal_line_truncate_points           r   r1   r1   q   s‚   € àÐÜ&/°Ö&<Ñ"ˆØ¤ Z£Ñ0°9Ó<ÙØœs :›Ñ.Òñ '=ð # ? NÐ3ÐØÑ,€JÞØ$-Ñ$CÐ!ØÐ :Ð!:Ð;ˆ
Ø×Ñ˜JÔ'ØÐr   N)r   ú	list[str]r   r   ÚreturnrA   )r   r   rB   ztuple[bool, int, int])r3   rA   r
   r   r   r   rB   rA   )r3   rA   r   r   rB   rA   )Ú__doc__Ú
__future__r   Ú_pytest.compatr   Ú_pytest.configr   Ú_pytest.nodesr   r   r   r2   r   r   r   r1   © r   r   Ú<module>rI      si   ðñõ #å (Ý !Ý ð Ð Ø%¨Ñ*Ð Ø€	ô	ô1ð*:Øð:àð:ð ð:ð ô	:õzr   