Skip to content

Commit 1775ba1

Browse files
author
y-p
committed
Merge pull request #6192 from y-p/PR_network
BLD/TST: @network, inspect formatted expection rather then str(e)
2 parents 66a3ce0 + b20fc15 commit 1775ba1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

pandas/io/tests/test_data.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ def test_get_quote_string(self):
145145

146146
@network
147147
def test_get_quote_stringlist(self):
148-
raise nose.SkipTest('unreliable test')
149148
df = web.get_quote_yahoo(['GOOG', 'AAPL', 'GOOG'])
150149
assert_series_equal(df.ix[0], df.ix[2])
151150

pandas/util/testing.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import subprocess
1313
import locale
1414
import unittest
15+
import traceback
1516

1617
from datetime import datetime
1718
from functools import wraps, partial
@@ -978,9 +979,10 @@ def dec(f):
978979

979980
# skip tests on exceptions with this message
980981
_network_error_messages = (
981-
'urlopen error timed out',
982-
'timeout: timed out',
983-
'socket.timeout: timed out',
982+
# 'urlopen error timed out',
983+
# 'timeout: timed out',
984+
# 'socket.timeout: timed out',
985+
'timed out',
984986
'HTTP Error 503: Service Unavailable',
985987
)
986988

@@ -1138,7 +1140,12 @@ def wrapper(*args, **kwargs):
11381140
raise SkipTest("Skipping test due to known errno"
11391141
" and error %s" % e)
11401142

1141-
if any([m.lower() in str(e).lower() for m in _skip_on_messages]):
1143+
try:
1144+
e_str = traceback.format_exc(e)
1145+
except:
1146+
e_str = str(e)
1147+
1148+
if any([m.lower() in e_str.lower() for m in _skip_on_messages]):
11421149
raise SkipTest("Skipping test because exception message is known"
11431150
" and error %s" % e)
11441151

0 commit comments

Comments
 (0)