From 7ce6ec7f50993ae254b3f6b0f0b5eff21582187c Mon Sep 17 00:00:00 2001 From: Alexandre Teixeira <111787685+alteixeira20@users.noreply.github.com> Date: Thu, 4 Jun 2026 18:20:41 +0100 Subject: [PATCH] fix(tests): use line-level PDF marker assertion Updates the PDF marker regression test to check corrupted markers at line level instead of using a broad substring assertion. Restores one focused part of the Python CI baseline tracked in #2580. --- tests/test_build_user_content_pdf_marker.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_build_user_content_pdf_marker.py b/tests/test_build_user_content_pdf_marker.py index 9cc9166..d57e0ef 100644 --- a/tests/test_build_user_content_pdf_marker.py +++ b/tests/test_build_user_content_pdf_marker.py @@ -50,8 +50,9 @@ def test_pdf_body_marker_stripped_without_eating_text(monkeypatch, tmp_path): ) body = content[0]["text"] if isinstance(content, list) else content - # The leading page text must survive intact. - assert "[Page 1 text]:" in body - assert "to the board, the agenda is set" in body - # The old lstrip(chars) corruption ate "[P" then "to" -> "age 1 text]: the board". - assert "age 1 text" not in body + body_lines = body.splitlines() + # The leading page marker and page text must survive intact. + assert "[Page 1 text]:" in body_lines + assert "to the board, the agenda is set" in body_lines + # The old lstrip(chars) corruption produced a line like "age 1 text]:" (missing "[P"). + assert "age 1 text]:" not in body_lines