§
    öyIf…  ã            
       ó  — 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Z
dZd	Z	 ddee         de	dee         dee         fd„Zde	defd„Z	 	 ddee         dee         dee         dee         fd„Zdee         dedee         fd„Zd
S )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.
é    )ÚList)ÚOptional)Úutil)ÚConfig)ÚItemé   i€  zuse '-vv' to showNÚexplanationÚitemÚ
max_lengthÚreturnc                 óB   — t          |¦  «        rt          | ¦  «        S | S )zGTruncate this assertion explanation if the given test item is eligible.)Ú_should_truncate_itemÚ_truncate_explanation)r	   r
   r   s      úN/var/www/piapp/venv/lib/python3.11/site-packages/_pytest/assertion/truncate.pyÚtruncate_if_requiredr      s(   € õ ˜TÑ"Ô"ð 2Ý$ [Ñ1Ô1Ð1ØÐó    c                 ó~   — | j                              t          j        ¦  «        }|dk     ot	          j        ¦   «          S )z9Whether or not this test item is eligible for truncation.é   )ÚconfigÚget_verbosityr   ÚVERBOSITY_ASSERTIONSr   Úrunning_on_ci)r
   Úverboses     r   r   r      s5   € àŒk×'Ò'­Ô(CÑDÔD€GØ�QŠ;Ð3�tÔ1Ñ3Ô3Ð3Ð3r   Úinput_linesÚ	max_linesÚ	max_charsc                 óþ  — |€t           }|€t          }t          d                     | ¦  «        ¦  «        }|dz   }|dz   }t          | ¦  «        |k    r||k    r| S | d|…         }d}t          d                     |¦  «        ¦  «        |k    rt	          ||¦  «        }nd}t          | ¦  «        t          |¦  «        z
  }|d         r|d         dz   |d<   |r|d	z  }nd|d<   g |¢d‘d
|› d|d	k    rdnd› dt
          › �‘S )a  Truncate given list of strings that makes up the assertion explanation.

    Truncates to either 8 lines, or 640 characters - whichever the input reaches
    first, taking the truncation explanation into account. The remaining lines
    will be replaced by a usage message.
    NÚ éF   r   TFéÿÿÿÿz...é   z...Full output truncated (z lineÚsz
 hidden), )ÚDEFAULT_MAX_LINESÚDEFAULT_MAX_CHARSÚlenÚjoinÚ_truncate_by_char_countÚ	USAGE_MSG)	r   r   r   Úinput_char_countÚtolerable_max_charsÚtolerable_max_linesÚtruncated_explanationÚtruncated_charÚtruncated_line_counts	            r   r   r   #   s‰  € ð ÐÝ%ˆ	ØÐÝ%ˆ	õ ˜2Ÿ7š7 ;Ñ/Ô/Ñ0Ô0Ðð 	�B‰ð ð $ a™-ÐåˆKÑÔÐ/Ò/Ð/ØÐ 3Ò3Ð3àÐà'¨
¨¨
Ô3ÐØ€Nå
ˆ2�7Š7Ð(Ñ)Ô)Ñ*Ô*Ð-@Ò@Ð@Ý 7Ø! 9ñ!
ô !
ÐÐð ˆå˜{Ñ+Ô+­cÐ2GÑ.HÔ.HÑHÐØ˜RÔ ð *à$9¸"Ô$=ÀÑ$EÐ˜bÑ!Øð 	&à  AÑ%Ð øð %*Ð˜bÑ!ðØ	ðà
ðð	KÐ%9ð 	Kð 	KØ%¨Ò*Ð*ˆ2ˆ2°ð	Kð 	KÝ?Hð	Kð 	Kðð r   c                 óø   — d}t          | ¦  «        D ]/\  }}|t          |¦  «        z   |k    r n|t          |¦  «        z  }Œ0| d |…         }| |         }|r||z
  }|d |…         }|                     |¦  «         |S )Nr   )Ú	enumerater%   Úappend)r   r   Úiterated_char_countÚiterated_indexÚ
input_lineÚtruncated_resultÚ
final_lineÚfinal_line_truncate_points           r   r'   r'   g   s­   € àÐÝ&/°Ñ&<Ô&<ð /ð /Ñ"ˆ˜
Ø¥ Z¡¤Ñ0°9Ò<Ð<ØˆEØ�s :™œÑ.ÐÐð # ? N ?Ô3ÐØ˜^Ô,€JØð <Ø$-Ð0CÑ$CÐ!ØÐ :Ð!:Ð :Ô;ˆ
Ø×Ò˜JÑ'Ô'Ð'ØÐr   )N)NN)Ú__doc__Útypingr   r   Ú_pytest.assertionr   Ú_pytest.configr   Ú_pytest.nodesr   r#   r$   r(   ÚstrÚintr   Úboolr   r   r'   © r   r   ú<module>rA      s†  ððð ð Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à "Ð "Ð "Ð "Ð "Ð "Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð ð Ð ØÐ Ø€	ð EIðð Ø�c”ðØ"&ðØ4<¸S´Mðà	ˆ#„Yðð ð ð ð4 ð 4¨ð 4ð 4ð 4ð 4ð  $Ø#ðAð AØ�c”ðAà˜Œ}ðAð ˜Œ}ðAð 
ˆ#„Yð	Að Að Að AðH¨¨c¬ð ¸sð ÀtÈCÄyð ð ð ð ð ð r   