Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Add xfail test for IndexError when extracting text #1124

Merged
merged 1 commit into from
Jul 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,14 @@ def test_get_fonts(pdf_path, password, embedded, unembedded):
a = a.union(a_tmp)
b = b.union(b_tmp)
assert (a, b) == (embedded, unembedded)


@pytest.mark.xfail(reason="#1091")
def test_text_extraction_issue_1091():
url = "https://corpora.tika.apache.org/base/docs/govdocs1/966/966635.pdf"
name = "tika-966635.pdf"
stream = BytesIO(get_pdf_from_url(url, name=name))
with pytest.warns(PdfReadWarning):
reader = PdfReader(stream)
for page in reader.pages:
page.extract_text()