From b3afa7c997de851c5e9da24e86e4321573aa0f9e Mon Sep 17 00:00:00 2001 From: y-p Date: Thu, 30 Jan 2014 23:36:12 +0200 Subject: [PATCH 1/2] BLD/TST: @network, inspect formatted expection rather then str(e) --- pandas/util/testing.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index c1d06eac4abf5..7eff8c4edf28d 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -12,6 +12,7 @@ import subprocess import locale import unittest +import traceback from datetime import datetime from functools import wraps, partial @@ -978,9 +979,10 @@ def dec(f): # skip tests on exceptions with this message _network_error_messages = ( - 'urlopen error timed out', - 'timeout: timed out', - 'socket.timeout: timed out', + # 'urlopen error timed out', + # 'timeout: timed out', + # 'socket.timeout: timed out', + 'timed out', 'HTTP Error 503: Service Unavailable', ) @@ -1138,7 +1140,12 @@ def wrapper(*args, **kwargs): raise SkipTest("Skipping test due to known errno" " and error %s" % e) - if any([m.lower() in str(e).lower() for m in _skip_on_messages]): + try: + e_str = traceback.format_exc(e) + except: + e_Str = str(e) + + if any([m.lower() in e_str.lower() for m in _skip_on_messages]): raise SkipTest("Skipping test because exception message is known" " and error %s" % e) From b20fc1540c51ad4d69ac7b71c8d53ee696c52a57 Mon Sep 17 00:00:00 2001 From: y-p Date: Thu, 30 Jan 2014 23:43:51 +0200 Subject: [PATCH 2/2] Revert "TST: skip the get_quote_stringlist in TestYahoo....failing from network issues too much" This reverts commit 0c938e600f5aaecc565ca945037dd8ef7160cf05. --- pandas/io/tests/test_data.py | 1 - pandas/util/testing.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py index 378befb0c0922..a044b388c00c4 100644 --- a/pandas/io/tests/test_data.py +++ b/pandas/io/tests/test_data.py @@ -145,7 +145,6 @@ def test_get_quote_string(self): @network def test_get_quote_stringlist(self): - raise nose.SkipTest('unreliable test') df = web.get_quote_yahoo(['GOOG', 'AAPL', 'GOOG']) assert_series_equal(df.ix[0], df.ix[2]) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 7eff8c4edf28d..41bad7f87f0da 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -1143,7 +1143,7 @@ def wrapper(*args, **kwargs): try: e_str = traceback.format_exc(e) except: - e_Str = str(e) + e_str = str(e) if any([m.lower() in e_str.lower() for m in _skip_on_messages]): raise SkipTest("Skipping test because exception message is known"