summaryrefslogtreecommitdiff
path: root/numpy/distutils/tests
diff options
context:
space:
mode:
authorAlan McIntyre <alan.mcintyre@local>2008-06-17 00:23:20 +0000
committerAlan McIntyre <alan.mcintyre@local>2008-06-17 00:23:20 +0000
commitc331857d8663ecf54bbe88c834755da749e8ab52 (patch)
treef4cc69ec328a5ff4d3b108f3610acb119a196493 /numpy/distutils/tests
parent22ba7886a84dc6a16ca75871f7cd2f10ef8de1f9 (diff)
downloadnumpy-c331857d8663ecf54bbe88c834755da749e8ab52.tar.gz
Switched to use nose to run tests. Added test and bench functions to all modules.
Diffstat (limited to 'numpy/distutils/tests')
-rw-r--r--numpy/distutils/tests/f2py_ext/tests/test_fib2.py6
-rw-r--r--numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py6
-rw-r--r--numpy/distutils/tests/gen_ext/tests/test_fib3.py6
-rw-r--r--numpy/distutils/tests/pyrex_ext/tests/test_primes.py6
-rw-r--r--numpy/distutils/tests/swig_ext/tests/test_example.py8
-rw-r--r--numpy/distutils/tests/swig_ext/tests/test_example2.py6
-rw-r--r--numpy/distutils/tests/test_fcompiler_gnu.py6
-rw-r--r--numpy/distutils/tests/test_misc_util.py19
8 files changed, 32 insertions, 31 deletions
diff --git a/numpy/distutils/tests/f2py_ext/tests/test_fib2.py b/numpy/distutils/tests/f2py_ext/tests/test_fib2.py
index 9a52ab17a..295397aad 100644
--- a/numpy/distutils/tests/f2py_ext/tests/test_fib2.py
+++ b/numpy/distutils/tests/f2py_ext/tests/test_fib2.py
@@ -4,10 +4,10 @@ set_package_path()
from f2py_ext import fib2
del sys.path[0]
-class TestFib2(NumpyTestCase):
+class TestFib2(TestCase):
- def check_fib(self):
+ def test_fib(self):
assert_array_equal(fib2.fib(6),[0,1,1,2,3,5])
if __name__ == "__main__":
- NumpyTest(fib2).run()
+ nose.run(argv=['', __file__])
diff --git a/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py b/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py
index 3d48f6ca9..40402e949 100644
--- a/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py
+++ b/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py
@@ -4,10 +4,10 @@ set_package_path()
from f2py_f90_ext import foo
del sys.path[0]
-class TestFoo(NumpyTestCase):
+class TestFoo(TestCase):
- def check_foo_free(self):
+ def test_foo_free(self):
assert_equal(foo.foo_free.bar13(),13)
if __name__ == "__main__":
- NumpyTest().run()
+ nose.run(argv=['', __file__])
diff --git a/numpy/distutils/tests/gen_ext/tests/test_fib3.py b/numpy/distutils/tests/gen_ext/tests/test_fib3.py
index b962a12aa..0c1e2d60d 100644
--- a/numpy/distutils/tests/gen_ext/tests/test_fib3.py
+++ b/numpy/distutils/tests/gen_ext/tests/test_fib3.py
@@ -4,10 +4,10 @@ set_package_path()
from gen_ext import fib3
del sys.path[0]
-class TestFib3(NumpyTestCase):
+class TestFib3(TestCase):
- def check_fib(self):
+ def test_fib(self):
assert_array_equal(fib3.fib(6),[0,1,1,2,3,5])
if __name__ == "__main__":
- NumpyTest().run()
+ nose.run(argv=['', __file__])
diff --git a/numpy/distutils/tests/pyrex_ext/tests/test_primes.py b/numpy/distutils/tests/pyrex_ext/tests/test_primes.py
index 1ca5ed8e7..c08da8651 100644
--- a/numpy/distutils/tests/pyrex_ext/tests/test_primes.py
+++ b/numpy/distutils/tests/pyrex_ext/tests/test_primes.py
@@ -5,9 +5,9 @@ set_package_path()
from pyrex_ext.primes import primes
restore_path()
-class TestPrimes(NumpyTestCase):
- def check_simple(self, level=1):
+class TestPrimes(TestCase):
+ def test_simple(self, level=1):
l = primes(10)
assert_equal(l, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29])
if __name__ == "__main__":
- NumpyTest().run()
+ nose.run(argv=['', __file__])
diff --git a/numpy/distutils/tests/swig_ext/tests/test_example.py b/numpy/distutils/tests/swig_ext/tests/test_example.py
index f24162077..6a3895295 100644
--- a/numpy/distutils/tests/swig_ext/tests/test_example.py
+++ b/numpy/distutils/tests/swig_ext/tests/test_example.py
@@ -4,15 +4,15 @@ set_package_path()
from swig_ext import example
restore_path()
-class TestExample(NumpyTestCase):
+class TestExample(TestCase):
- def check_fact(self):
+ def test_fact(self):
assert_equal(example.fact(10),3628800)
- def check_cvar(self):
+ def test_cvar(self):
assert_equal(example.cvar.My_variable,3.0)
example.cvar.My_variable = 5
assert_equal(example.cvar.My_variable,5.0)
if __name__ == "__main__":
- NumpyTest().run()
+ nose.run(argv=['', __file__])
diff --git a/numpy/distutils/tests/swig_ext/tests/test_example2.py b/numpy/distutils/tests/swig_ext/tests/test_example2.py
index 3150e1a16..3cb1db201 100644
--- a/numpy/distutils/tests/swig_ext/tests/test_example2.py
+++ b/numpy/distutils/tests/swig_ext/tests/test_example2.py
@@ -4,9 +4,9 @@ set_package_path()
from swig_ext import example2
restore_path()
-class TestExample2(NumpyTestCase):
+class TestExample2(TestCase):
- def check_zoo(self):
+ def test_zoo(self):
z = example2.Zoo()
z.shut_up('Tiger')
z.shut_up('Lion')
@@ -14,4 +14,4 @@ class TestExample2(NumpyTestCase):
if __name__ == "__main__":
- NumpyTest().run()
+ nose.run(argv=['', __file__])
diff --git a/numpy/distutils/tests/test_fcompiler_gnu.py b/numpy/distutils/tests/test_fcompiler_gnu.py
index 002d360b9..99384bc8f 100644
--- a/numpy/distutils/tests/test_fcompiler_gnu.py
+++ b/numpy/distutils/tests/test_fcompiler_gnu.py
@@ -21,7 +21,7 @@ gfortran_version_strings = [
('GNU Fortran (GCC) 4.3.0 20070316 (experimental)', '4.3.0'),
]
-class TestG77Versions(NumpyTestCase):
+class TestG77Versions(TestCase):
def test_g77_version(self):
fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu')
for vs, version in g77_version_strings:
@@ -34,7 +34,7 @@ class TestG77Versions(NumpyTestCase):
v = fc.version_match(vs)
assert v is None, (vs, v)
-class TestGortranVersions(NumpyTestCase):
+class TestGortranVersions(TestCase):
def test_gfortran_version(self):
fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu95')
for vs, version in gfortran_version_strings:
@@ -49,4 +49,4 @@ class TestGortranVersions(NumpyTestCase):
if __name__ == '__main__':
- NumpyTest.run()
+ nose.run(argv=['', __file__])
diff --git a/numpy/distutils/tests/test_misc_util.py b/numpy/distutils/tests/test_misc_util.py
index 4d2404092..fed1567b7 100644
--- a/numpy/distutils/tests/test_misc_util.py
+++ b/numpy/distutils/tests/test_misc_util.py
@@ -8,15 +8,15 @@ from os.path import join, sep
ajoin = lambda *paths: join(*((sep,)+paths))
-class TestAppendpath(NumpyTestCase):
+class TestAppendpath(TestCase):
- def check_1(self):
+ def test_1(self):
assert_equal(appendpath('prefix','name'),join('prefix','name'))
assert_equal(appendpath('/prefix','name'),ajoin('prefix','name'))
assert_equal(appendpath('/prefix','/name'),ajoin('prefix','name'))
assert_equal(appendpath('prefix','/name'),join('prefix','name'))
- def check_2(self):
+ def test_2(self):
assert_equal(appendpath('prefix/sub','name'),
join('prefix','sub','name'))
assert_equal(appendpath('prefix/sub','sup/name'),
@@ -24,7 +24,7 @@ class TestAppendpath(NumpyTestCase):
assert_equal(appendpath('/prefix/sub','/prefix/name'),
ajoin('prefix','sub','name'))
- def check_3(self):
+ def test_3(self):
assert_equal(appendpath('/prefix/sub','/prefix/sup/name'),
ajoin('prefix','sub','sup','name'))
assert_equal(appendpath('/prefix/sub/sub2','/prefix/sup/sup2/name'),
@@ -32,9 +32,9 @@ class TestAppendpath(NumpyTestCase):
assert_equal(appendpath('/prefix/sub/sub2','/prefix/sub/sup/name'),
ajoin('prefix','sub','sub2','sup','name'))
-class TestMinrelpath(NumpyTestCase):
+class TestMinrelpath(TestCase):
- def check_1(self):
+ def test_1(self):
import os
n = lambda path: path.replace('/',os.path.sep)
assert_equal(minrelpath(n('aa/bb')),n('aa/bb'))
@@ -47,14 +47,15 @@ class TestMinrelpath(NumpyTestCase):
assert_equal(minrelpath(n('.././..')),n('../..'))
assert_equal(minrelpath(n('aa/bb/.././../dd')),n('dd'))
-class TestGpaths(NumpyTestCase):
+class TestGpaths(TestCase):
- def check_gpaths(self):
+ def test_gpaths(self):
local_path = minrelpath(os.path.join(os.path.dirname(__file__),'..'))
ls = gpaths('command/*.py', local_path)
assert os.path.join(local_path,'command','build_src.py') in ls,`ls`
f = gpaths('system_info.py', local_path)
assert os.path.join(local_path,'system_info.py')==f[0],`f`
+
if __name__ == "__main__":
- NumpyTest().run()
+ nose.run(argv=['', __file__])