Skip to content

Commit b3afa7c

Browse files
author
y-p
committed
BLD/TST: @network, inspect formatted expection rather then str(e)
1 parent 0c938e6 commit b3afa7c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

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)