Skip to content

Commit

Permalink
TST: Ignore PdfReadWarning in benchmark (#949)
Browse files Browse the repository at this point in the history
Ignore the PdfReadWarning in the benchmarking code as it is only supposed to be used for performance testing.
  • Loading branch information
MartinThoma authored Jun 6, 2022
1 parent 3a0bd5e commit b008412
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/bench.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os

import pytest

import PyPDF2
from PyPDF2 import PdfReader, Transformation
from PyPDF2.generic import Destination
Expand Down Expand Up @@ -125,6 +127,7 @@ def text_extraction(pdf_path):
return text


@pytest.mark.filterwarnings("ignore::PyPDF2.errors.PdfReadWarning")
def test_text_extraction(benchmark):
file = os.path.join(SAMPLE_ROOT, "009-pdflatex-geotopo/GeoTopo.pdf")
benchmark(text_extraction, file)

0 comments on commit b008412

Please sign in to comment.