diff options
author | Alan McIntyre <alan.mcintyre@local> | 2008-06-17 00:23:20 +0000 |
---|---|---|
committer | Alan McIntyre <alan.mcintyre@local> | 2008-06-17 00:23:20 +0000 |
commit | c331857d8663ecf54bbe88c834755da749e8ab52 (patch) | |
tree | f4cc69ec328a5ff4d3b108f3610acb119a196493 /numpy/fft/tests/test_helper.py | |
parent | 22ba7886a84dc6a16ca75871f7cd2f10ef8de1f9 (diff) | |
download | numpy-c331857d8663ecf54bbe88c834755da749e8ab52.tar.gz |
Switched to use nose to run tests. Added test and bench functions to all modules.
Diffstat (limited to 'numpy/fft/tests/test_helper.py')
-rw-r--r-- | numpy/fft/tests/test_helper.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/fft/tests/test_helper.py b/numpy/fft/tests/test_helper.py index aaec6530a..42678fb79 100644 --- a/numpy/fft/tests/test_helper.py +++ b/numpy/fft/tests/test_helper.py @@ -7,16 +7,15 @@ import sys from numpy.testing import * set_package_path() from numpy.fft import fftshift,ifftshift,fftfreq -del sys.path[0] +restore_path() from numpy import pi def random(size): return rand(*size) -class TestFFTShift(NumpyTestCase): - - def check_definition(self): +class TestFFTShift(TestCase): + def test_definition(self): x = [0,1,2,3,4,-4,-3,-2,-1] y = [-4,-3,-2,-1,0,1,2,3,4] assert_array_almost_equal(fftshift(x),y) @@ -26,14 +25,14 @@ class TestFFTShift(NumpyTestCase): assert_array_almost_equal(fftshift(x),y) assert_array_almost_equal(ifftshift(y),x) - def check_inverse(self): + def test_inverse(self): for n in [1,4,9,100,211]: x = random((n,)) assert_array_almost_equal(ifftshift(fftshift(x)),x) -class TestFFTFreq(NumpyTestCase): - def check_definition(self): +class TestFFTFreq(TestCase): + def test_definition(self): x = [0,1,2,3,4,-4,-3,-2,-1] assert_array_almost_equal(9*fftfreq(9),x) assert_array_almost_equal(9*pi*fftfreq(9,pi),x) @@ -41,5 +40,6 @@ class TestFFTFreq(NumpyTestCase): assert_array_almost_equal(10*fftfreq(10),x) assert_array_almost_equal(10*pi*fftfreq(10,pi),x) + if __name__ == "__main__": - NumpyTest().run() + nose.run(argv=['', __file__]) |