Skip to content

Commit

Permalink
More robust tests to pass build
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Nov 14, 2024
1 parent cea32b6 commit 01e730d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ def titleName(row):
def country_population():
from lxml import etree
from urllib.request import urlopen
page = urlopen('https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population').read()
for i in range(3):
try:
page = urlopen('https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population', timeout=30).read()
break
except:
pass
parser = etree.HTMLParser()
tree = etree.fromstring(page, parser=parser)
tables = tree.findall('.//table')
Expand Down

0 comments on commit 01e730d

Please sign in to comment.