Skip to content

Commit

Permalink
Robustify unit tests html provider
Browse files Browse the repository at this point in the history
  • Loading branch information
GjjvdBurg committed Jan 4, 2025
1 parent dc0c3a0 commit 39716a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_custom_css(self):
prov = HTML(upload=False, css=test_css, font_urls=test_font_urls)
filename = prov.run(url)
with pdfplumber.open(filename) as pdf:
self.assertEqual(7, len(pdf.pages))
self.assertIn(len(pdf.pages), [7, 8])

os.unlink(filename)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def test_html_3(self):
filename = prov.run(url)
self.assertEqual(exp, os.path.basename(filename))
# this is a proxy test to check that all images are included
self.assertEqual(32, len(pdfplumber.open(filename).pages))
self.assertIn(len(pdfplumber.open(filename).pages), [32, 33])

@unittest.skip("Broken test (other url needed)")
def test_html_4(self):
Expand Down

0 comments on commit 39716a6

Please sign in to comment.