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/tests | |
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/tests')
-rw-r--r-- | numpy/tests/test_ctypeslib.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/numpy/tests/test_ctypeslib.py b/numpy/tests/test_ctypeslib.py index 5d21a09ea..12e4dce01 100644 --- a/numpy/tests/test_ctypeslib.py +++ b/numpy/tests/test_ctypeslib.py @@ -2,8 +2,8 @@ import numpy as np from numpy.ctypeslib import ndpointer, load_library from numpy.testing import * -class TestLoadLibrary(NumpyTestCase): - def check_basic(self): +class TestLoadLibrary(TestCase): + def test_basic(self): try: cdll = load_library('multiarray', np.core.multiarray.__file__) @@ -12,7 +12,7 @@ class TestLoadLibrary(NumpyTestCase): " (import error was: %s)" % str(e) print msg - def check_basic2(self): + def test_basic2(self): """Regression for #801: load_library with a full library name (including extension) does not work.""" try: @@ -28,8 +28,8 @@ class TestLoadLibrary(NumpyTestCase): " (import error was: %s)" % str(e) print msg -class TestNdpointer(NumpyTestCase): - def check_dtype(self): +class TestNdpointer(TestCase): + def test_dtype(self): dt = np.intc p = ndpointer(dtype=dt) self.assert_(p.from_param(np.array([1], dt))) @@ -56,7 +56,7 @@ class TestNdpointer(NumpyTestCase): else: self.assert_(p.from_param(np.zeros((10,), dt2))) - def check_ndim(self): + def test_ndim(self): p = ndpointer(ndim=0) self.assert_(p.from_param(np.array(1))) self.assertRaises(TypeError, p.from_param, np.array([1])) @@ -66,14 +66,14 @@ class TestNdpointer(NumpyTestCase): p = ndpointer(ndim=2) self.assert_(p.from_param(np.array([[1]]))) - def check_shape(self): + def test_shape(self): p = ndpointer(shape=(1,2)) self.assert_(p.from_param(np.array([[1,2]]))) self.assertRaises(TypeError, p.from_param, np.array([[1],[2]])) p = ndpointer(shape=()) self.assert_(p.from_param(np.array(1))) - def check_flags(self): + def test_flags(self): x = np.array([[1,2,3]], order='F') p = ndpointer(flags='FORTRAN') self.assert_(p.from_param(x)) @@ -83,5 +83,6 @@ class TestNdpointer(NumpyTestCase): self.assert_(p.from_param(x)) self.assertRaises(TypeError, p.from_param, np.array([[1,2,3]])) + if __name__ == "__main__": - NumpyTest().run() + nose.run(argv=['', __file__]) |