8@: d Z ddlmZ ddlmZ ddlmZ ddlmZ dZdZ dZ dd ee dedee d ee fdZ ded efdZ ddee dee dee d ee fdZdee ded ee fdZd S )zUtilities for truncating assertion output. Current default behaviour is to truncate assertion explanations at ~8 terminal lines, unless running in "-vv" mode or running on CI. )List)Optional)util)Item i zuse '-vv' to showNexplanationitem max_lengthreturnc B t | rt | S | S )zGTruncate this assertion explanation if the given test item is eligible.)_should_truncate_item_truncate_explanation)r r r s l/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/_pytest/assertion/truncate.pytruncate_if_requiredr s( T"" 2$[111 c X | j j j }|dk ot j S )z9Whether or not this test item is eligible for truncation. )configoptionverboser running_on_ci)r r s r r r s* k (GQ;3t13333r input_lines max_lines max_charsc |t }|t }t d | }|dz }|dz }t | |k r||k r| S | d| }d}t d | |k rt || }nd}t | t | z }|d r|d dz |d<