Skip to content

Commit f27a339

Browse files
[doc] Better documentation in _truncate_explanation
1 parent 6762f5a commit f27a339

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/_pytest/assertion/truncate.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ def _truncate_explanation(
5959
Truncates to either max_lines, or max_chars - whichever the input reaches
6060
first, taking the truncation explanation into account. The remaining lines
6161
will be replaced by a usage message.
62+
63+
If max_chars=0, no truncation by character count is performed.
64+
If max_lines=0, no truncation by line count is performed.
65+
66+
When this function is launched we know max_lines > 0 or max_chars > 0
67+
because _get_truncation_parameters was called first.
6268
"""
6369
# Check if truncation required
6470
input_char_count = len("".join(input_lines))

0 commit comments

Comments
 (0)