From 25ff9569e457b5531a7ddceb743c0313c848d1bd Mon Sep 17 00:00:00 2001 From: elmotec Date: Sun, 18 Oct 2015 09:42:58 -0400 Subject: [PATCH] Fixed test_search Could reproduce the problem on Ubuntu only with Python 3.4. It just seemed to crash. Removed the use of zip function seem to do the trick. The test looks better anyway with a single assert and no loop. The only cost is what looks like unnecessary spaces at the end of the line. --- fredapi/tests/test_fred.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fredapi/tests/test_fred.py b/fredapi/tests/test_fred.py index a88c4e8..0db0187 100644 --- a/fredapi/tests/test_fred.py +++ b/fredapi/tests/test_fred.py @@ -150,7 +150,6 @@ def setUp(self): self.fake_fred_call = fake_fred_call self.__original_urlopen = fredapi.fred.urlopen - def tearDown(self): """Cleanup.""" pass @@ -249,12 +248,11 @@ def test_search(self, urlopen): 'seasonal_adjustment_short']]) expected = textwrap.dedent('''\ popularity observation_start seasonal_adjustment_short - series id + series id PCPI01001 0 1969-01-01 NSA PCPI01003 0 1969-01-01 NSA PCPI01005 0 1969-01-01 NSA''') - for aline, eline in zip(actual.split('\n'), expected.split('\n')): - self.assertEqual(aline.strip(), eline.strip()) + self.assertEqual(actual.split('\n'), expected.split('\n')) if __name__ == '__main__':