Skip to content

Commit 01e730d

Browse files
committed
More robust tests to pass build
1 parent cea32b6 commit 01e730d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_examples.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ def titleName(row):
3737
def country_population():
3838
from lxml import etree
3939
from urllib.request import urlopen
40-
page = urlopen('https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population').read()
40+
for i in range(3):
41+
try:
42+
page = urlopen('https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population', timeout=30).read()
43+
break
44+
except:
45+
pass
4146
parser = etree.HTMLParser()
4247
tree = etree.fromstring(page, parser=parser)
4348
tables = tree.findall('.//table')

0 commit comments

Comments
 (0)