Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 8727534

Browse files
committed
Add infinity test
The Network parser could'nt handle this kind of table. It was running infinitely.
1 parent 88a3c3d commit 8727534

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_network.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,18 @@ def test_network_layout_kwargs(testdir):
140140
filename, flavor="network", layout_kwargs={"detect_vertical": False}
141141
)
142142
assert_frame_equal(df, tables[0].df)
143+
144+
145+
def test_network_no_infinite_execution(testdir):
146+
"""Test for not infinite execution.
147+
148+
This test used to fail, because the network parse was'nt able to process the tables on this pages.
149+
After a refactor it stops infinite execution. But parsing result could be improved.
150+
Hence this is no qualitative test.
151+
"""
152+
filename = os.path.join(testdir, "tabula/schools.pdf")
153+
tables = camelot.read_pdf(
154+
filename, flavor="network", backend="ghostscript", pages="4"
155+
)
156+
157+
assert len(tables) >= 1

0 commit comments

Comments
 (0)