Skip to content

Commit 495b608

Browse files
committed
TST: skip another @network test if no internet connection
1 parent 564f66f commit 495b608

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

pandas/io/tests/test_parsers.py

+19-8
Original file line numberDiff line numberDiff line change
@@ -1356,14 +1356,25 @@ def test_na_value_dict(self):
13561356
@slow
13571357
@network
13581358
def test_url(self):
1359-
# HTTP(S)
1360-
url = 'https://raw.github.com/pydata/pandas/master/pandas/io/tests/salary.table'
1361-
url_table = read_table(url)
1362-
dirpath = curpath()
1363-
localtable = os.path.join(dirpath, 'salary.table')
1364-
local_table = read_table(localtable)
1365-
assert_frame_equal(url_table, local_table)
1366-
#TODO: ftp testing
1359+
import urllib2
1360+
try:
1361+
# HTTP(S)
1362+
url = ('https://raw.github.com/pydata/pandas/master/'
1363+
'pandas/io/tests/salary.table')
1364+
url_table = read_table(url)
1365+
dirpath = curpath()
1366+
localtable = os.path.join(dirpath, 'salary.table')
1367+
local_table = read_table(localtable)
1368+
assert_frame_equal(url_table, local_table)
1369+
#TODO: ftp testing
1370+
1371+
except urllib2.URLError:
1372+
try:
1373+
urllib2.urlopen('http://www.google.com')
1374+
except urllib2.URLError:
1375+
raise nose.SkipTest
1376+
else:
1377+
raise
13671378

13681379
@slow
13691380
def test_file(self):

0 commit comments

Comments
 (0)