Skip to content

Commit 1a78d86

Browse files
authored
MAINT: Change comments (#3218)
Slight changes, including removal of comments about previous values.
1 parent 9f91c27 commit 1a78d86

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tests/test_text_extraction.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def test_multi_language(visitor_text):
7171
{
7272
"A": lambda x, y: 0 < x < 94 and 189 < y < 283, # In upper left
7373
"B": lambda x, y: 94 < x < 189 and 94 < y < 189, # In the center
74-
"C": lambda x, y: 189 < x < 283 and 0 < y < 94,
75-
}, # In lower right
74+
"C": lambda x, y: 189 < x < 283 and 0 < y < 94, # In lower right
75+
},
7676
)
7777
],
7878
)
@@ -89,10 +89,8 @@ def test_visitor_text_matrices(file_name, constraints):
8989

9090
def visitor_text(text, cm, tm, font_dict, font_size) -> None:
9191
ctm = mult(tm, cm)
92-
x = ctm[4] # used to tm[4] * cm[0] + tm[5] * cm[2] + cm[4] # mult(tm, cm)[4]
93-
y = ctm[
94-
5
95-
] # used to be tm[4] * cm[1] + tm[5] * cm[3] + cm[5] # mult(tm, cm)[5]
92+
x = ctm[4] # mult(tm, cm)[4]
93+
y = ctm[5] # mult(tm, cm)[5]
9694
lines.append({"text": text, "x": x, "y": y})
9795

9896
reader.pages[0].extract_text(visitor_text=visitor_text)
@@ -156,7 +154,7 @@ def test_layout_mode_epic_page_fonts():
156154

157155

158156
def test_layout_mode_uncommon_operators():
159-
# coverage for layout mode Tc, Tz, Ts, ', ", TD, TL, and Tw
157+
# Coverage for layout mode Tc, Tz, Ts, ', ", TD, TL, and Tw
160158
reader = PdfReader(RESOURCE_ROOT / "toy.pdf")
161159
expected = (RESOURCE_ROOT / "toy.layout.txt").read_text(encoding="utf-8")
162160
assert expected == reader.pages[0].extract_text(extraction_mode="layout")
@@ -178,7 +176,7 @@ def test_layout_mode_type0_font_widths():
178176
@pytest.mark.enable_socket
179177
def test_layout_mode_indirect_sequence_font_widths():
180178
# Cover the situation where the sequence for font widths is an IndirectObject
181-
# ref https://github.com/py-pdf/pypdf/pull/2788
179+
# https://github.com/py-pdf/pypdf/pull/2788
182180
url = "https://github.com/user-attachments/files/16491621/2788_example.pdf"
183181
name = "2788_example.pdf"
184182
reader = PdfReader(BytesIO(get_data_from_url(url, name=name)))
@@ -287,7 +285,7 @@ def test_infinite_loop_arrays():
287285

288286
@pytest.mark.enable_socket
289287
def test_content_stream_is_dictionary_object(caplog):
290-
"""Tests for #2995."""
288+
"""Tests for #2995"""
291289
url = "https://github.com/user-attachments/files/18049322/6fa5fd46-5f98-4a67-800d-5e2362b0164f.pdf"
292290
name = "iss2995.pdf"
293291
data = get_data_from_url(url, name=name)

0 commit comments

Comments
 (0)