Made tests more robust

master
Per A Brodtkorb 9 years ago
parent 8b4e4dae57
commit 891510e42f

@ -1,15 +1,14 @@
import unittest import unittest
import numpy as np import numpy as np
from numpy.testing import assert_array_almost_equal
from wafo.spectrum.models import (Bretschneider, Jonswap, OchiHubble, Tmaspec, from wafo.spectrum.models import (Bretschneider, Jonswap, OchiHubble, Tmaspec,
Torsethaugen, McCormick, Wallop, Spreading) Torsethaugen, McCormick, Wallop, Spreading)
class TestCase(unittest.TestCase): class TestCase(unittest.TestCase):
def assertListAlmostEqual(self, list1, list2, places=None, msg=None): def assertListAlmostEqual(self, list1, list2, decimal=5, msg=''):
self.assertEqual(len(list1), len(list2)) assert_array_almost_equal(list1, list2, decimal, msg)
for a, b in zip(list1, list2):
self.assertAlmostEqual(a, b, places, msg)
class TestSpectra(TestCase): class TestSpectra(TestCase):

Loading…
Cancel
Save