Skip to content

Commit 66a1637

Browse files
committed
TST: skip to_file test if URLError occurs on some systems
1 parent 339c6b3 commit 66a1637

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pandas/io/tests/test_parsers.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1435,14 +1435,21 @@ def test_url(self):
14351435

14361436
@slow
14371437
def test_file(self):
1438+
import urllib2
1439+
14381440
# FILE
14391441
if sys.version_info[:2] < (2, 6):
14401442
raise nose.SkipTest("file:// not supported with Python < 2.6")
14411443
dirpath = curpath()
14421444
localtable = os.path.join(dirpath, 'salary.table')
14431445
local_table = read_table(localtable)
14441446

1445-
url_table = read_table('file://localhost/'+localtable)
1447+
try:
1448+
url_table = read_table('file://localhost/'+localtable)
1449+
except urllib2.URLError:
1450+
# fails on some systems
1451+
raise nose.SkipTest
1452+
14461453
assert_frame_equal(url_table, local_table)
14471454

14481455
def test_parse_tz_aware(self):

0 commit comments

Comments
 (0)