From c7ff981d4e9aeb22c9676efd381b82032a048b10 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Tue, 6 Aug 2013 21:28:00 +0200 Subject: [PATCH 1/2] BUG: off-by-one when doing network test repeats Imagine num_runs is two, then runs will take on the values [0, 1] and runs < num_uns will always be False. Hence any genuine Exception the code might raise will be silently ignored and just printed. --- pandas/util/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index abc13fb2ad9ee..2667739a59f80 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -845,7 +845,7 @@ def network_wrapper(*args, **kwargs): except SkipTest: raise except Exception as e: - if runs < num_runs: + if runs < num_runs - 1: print("Failed: %r" % e) else: raise From 7f3823efd66b45e63a78138c1d86810d8b060923 Mon Sep 17 00:00:00 2001 From: Valentin Haenel Date: Tue, 6 Aug 2013 23:12:30 +0200 Subject: [PATCH 2/2] BUG/TST: fix (and skip) test that has been failing unnoticed all along The test is unstable and although this makes it work properly, no one knows how long. Hence it was decided to skip this guy until further notice. See also: #4427 --- pandas/io/tests/test_data.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py index 34b2811876f30..f7a018f5152ca 100644 --- a/pandas/io/tests/test_data.py +++ b/pandas/io/tests/test_data.py @@ -368,12 +368,13 @@ def test_fred(self): Throws an exception when DataReader can't get a 200 response from FRED. """ + + raise nose.SkipTest('Skip as this is unstable #4427 ') start = datetime(2010, 1, 1) end = datetime(2013, 1, 27) - self.assertEquals( - web.DataReader("GDP", "fred", start, end)['GDP'].tail(1), - 15984.1) + received = web.DataReader("GDP", "fred", start, end)['GDP'].tail(1)[0] + self.assertEquals(int(received), 16535) self.assertRaises(Exception, web.DataReader, "NON EXISTENT SERIES", 'fred', start, end)