§
    o¬¸j>  ã                  ól   — d Z ddlmZ ddlmZ ddlmZ ddlmZ dZ	e	dz  Z
dZdd„Zdd„Zdd„Zd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.
é    )Úannotations)Úrunning_on_ci)ÚConfig)ÚItemé   éP   zuse '-vv' to showÚexplanationú	list[str]Úitemr   Úreturnc                óT   — t          |¦  «        \  }}}|rt          | ||¬¦  «        S | S )zGTruncate this assertion explanation if the given test item is eligible.)Ú	max_linesÚ	max_chars)Ú_get_truncation_parametersÚ_truncate_explanation)r	   r   Úshould_truncater   r   s        új/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/_pytest/assertion/truncate.pyÚtruncate_if_requiredr      sF   € å,FÀtÑ,LÔ,LÑ)€O�Y 	Øð 
Ý$ØØØð
ñ 
ô 
ð 	
ð
 Ðó    útuple[bool, int, int]c                ób  — | j                              d¦  «        }t          |�|nt          ¦  «        }| j                              d¦  «        }t          |�|nt          ¦  «        }| j                              t          j        ¦  «        }|dk     ot          ¦   «          }|o|dk    p|dk    }|||fS )zgReturn the truncation parameters related to the given item, as (should truncate, max lines, max chars).Útruncation_limit_linesNÚ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�IÕ<MÑNÔN€Ià”×"Ò"Ð#;Ñ<Ô<€IÝ Ð!6�I�IÕ<MÑNÔN€IàŒk×'Ò'­Ô(CÑDÔD€Gà ’kÐ9­-©/¬/Ð&9€OØ%ÐJ¨9°qª=Ð+I¸IÈºM€Oà˜I yÐ0Ð0r   Úinput_linesr   r   r   c                ó  — t          d                     | ¦  «        ¦  «        }|dz   }|dz   }t          | ¦  «        |k    r||k    r| S |dk    r| d|…         }n| }d}t          d                     |¦  «        ¦  «        |k    r|dk    rt          ||¦  «        }nd}|| k    r|S 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 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.
    Ú éF   r   r   NTFéÿÿÿÿz...é   z...Full output truncated (z lineÚsz
 hidden), )Ú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   4   s�  € õ ˜2Ÿ7š7 ;Ñ/Ô/Ñ0Ô0Ðð 	�B‰ð ð $ a™-ÐåˆKÑÔÐ/Ò/Ð/ØÐ 3Ò3Ð3àÐà�1‚}€}Ø +¨J¨Y¨JÔ 7ÐÐà +ÐØ€Nå
ˆ2�7Š7Ð(Ñ)Ô)Ñ*Ô*Ð-@Ò@Ð@ÀYÐQRÂ]À]Ý 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,   z   s­   € àÐÝ&/°Ñ&<Ô&<ð /ð /Ñ"ˆ˜
Ø¥ Z¡¤Ñ0°9Ò<Ð<ØˆEØ�s :™œÑ.ÐÐð # ? N ?Ô3ÐØ˜^Ô,€JØð <Ø$-Ð0CÑ$CÐ!ØÐ :Ð!:Ð :Ô;ˆ
Ø×Ò˜JÑ'Ô'Ð'ØÐr   N)r	   r
   r   r   r   r
   )r   r   r   r   )r#   r
   r   r   r   r   r   r
   )r#   r
   r   r   r   r
   )Ú__doc__Ú
__future__r   Ú_pytest.compatr   Ú_pytest.configr   Ú_pytest.nodesr   r   r   r-   r   r   r   r,   © r   r   ú<module>rC      sÐ   ððð ð #Ð "Ð "Ð "Ð "Ð "à (Ð (Ð (Ð (Ð (Ð (Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð ð Ð Ø%¨Ñ*Ð Ø€	ð	ð 	ð 	ð 	ð1ð 1ð 1ð 1ð*Cð Cð Cð CðLð ð ð ð ð r   