From 66bed1ea699b8a2b504163b5708c1815f4a8b6ba Mon Sep 17 00:00:00 2001 From: Muhammad Haris Awan Date: Thu, 23 Jul 2026 22:10:02 +0500 Subject: [PATCH 1/2] Fix: Change truncation_limit_lines and chars to accept int in configs --- src/_pytest/assertion/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_pytest/assertion/__init__.py b/src/_pytest/assertion/__init__.py index e33f8b29609..e8d1e3f77dd 100644 --- a/src/_pytest/assertion/__init__.py +++ b/src/_pytest/assertion/__init__.py @@ -49,11 +49,13 @@ def pytest_addoption(parser: Parser) -> None: parser.addini( "truncation_limit_lines", + type="int", default=None, help="Set threshold of LINES after which truncation will take effect", ) parser.addini( "truncation_limit_chars", + type="int", default=None, help=("Set threshold of CHARS after which truncation will take effect"), ) From 70b1f30d1310719c4b23063ffecf69620b47fbc2 Mon Sep 17 00:00:00 2001 From: Muhammad Haris Awan Date: Thu, 23 Jul 2026 22:37:17 +0500 Subject: [PATCH 2/2] Add changelog entry --- changelog/14675.improvement.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/14675.improvement.rst diff --git a/changelog/14675.improvement.rst b/changelog/14675.improvement.rst new file mode 100644 index 00000000000..6a9d4808cc0 --- /dev/null +++ b/changelog/14675.improvement.rst @@ -0,0 +1 @@ +Allowed integer values for :confval:`truncation_limit_lines` and :confval:`truncation_limit_chars` in configurations.