Skip to content

Commit

Permalink
TST: Fix benchmark failures (#2481)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan6419846 committed Feb 28, 2024
1 parent 178014e commit 40e3843
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def merge():

outline_item = writer.add_outline_item("An outline item", 0)
writer.add_outline_item("deeper", 0, parent=outline_item)
writer.add_metadata({"author": "Martin Thoma"})
writer.add_metadata({"/Author": "Martin Thoma"})
writer.add_named_destination("title", 0)
writer.set_page_layout("/SinglePage")
writer.page_mode = "/UseThumbs"
Expand Down Expand Up @@ -133,10 +133,11 @@ def test_merge(benchmark):


def text_extraction(pdf_path):
reader = PdfReader(pdf_path)
text = ""
for page in reader.pages:
text += page.extract_text()
with open(pdf_path, mode="rb") as fd:
reader = PdfReader(fd)
text = ""
for page in reader.pages:
text += page.extract_text()
return text


Expand Down

0 comments on commit 40e3843

Please sign in to comment.