From 891510e42ff6b335e9d79d090feb2263ed94e2bd Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Sun, 14 Feb 2016 02:08:48 +0100 Subject: [PATCH] Made tests more robust --- wafo/spectrum/tests/test_models.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wafo/spectrum/tests/test_models.py b/wafo/spectrum/tests/test_models.py index a52eb9f..d7c72bc 100644 --- a/wafo/spectrum/tests/test_models.py +++ b/wafo/spectrum/tests/test_models.py @@ -1,15 +1,14 @@ import unittest import numpy as np +from numpy.testing import assert_array_almost_equal from wafo.spectrum.models import (Bretschneider, Jonswap, OchiHubble, Tmaspec, Torsethaugen, McCormick, Wallop, Spreading) class TestCase(unittest.TestCase): - def assertListAlmostEqual(self, list1, list2, places=None, msg=None): - self.assertEqual(len(list1), len(list2)) - for a, b in zip(list1, list2): - self.assertAlmostEqual(a, b, places, msg) + def assertListAlmostEqual(self, list1, list2, decimal=5, msg=''): + assert_array_almost_equal(list1, list2, decimal, msg) class TestSpectra(TestCase):