[Scipy-svn] r3822 - in trunk/scipy: . cluster cluster/tests fftpack fftpack/tests integrate integrate/tests interpolate interpolate/tests io io/matlab/tests lib lib/blas lib/blas/tests lib/lapack lib/lapack/tests linalg linalg/tests linsolve linsolve/umfpack linsolve/umfpack/tests maxentropy maxentropy/tests misc misc/tests ndimage ndimage/segment/tests ndimage/tests odr odr/tests optimize optimize/tests sandbox/arpack/tests sandbox/buildgrid sandbox/cdavid sandbox/constants sandbox/delaunay/tests sandbox/dhuard sandbox/dhuard/tests sandbox/fdfpack/tests sandbox/lobpcg sandbox/lobpcg/tests sandbox/maskedarray sandbox/maskedarray/alternative_versions sandbox/montecarlo/tests sandbox/multigrid sandbox/multigrid/tests sandbox/numexpr sandbox/numexpr/tests sandbox/pyloess sandbox/pyloess/tests sandbox/rbf sandbox/rbf/tests sandbox/spline sandbox/spline/tests sandbox/timeseries sandbox/timeseries/lib sandbox/timeseries/lib/tests sandbox/timeseries/tests signal signal/tests sparse sparse/tests special special/tests stats stats/models stats/models/tests stats/tests testing weave weave/tests

scipy-svn@scip... scipy-svn@scip...
Sat Jan 12 04:08:45 CST 2008


Author: matthew.brett@gmail.com
Date: 2008-01-12 04:06:39 -0600 (Sat, 12 Jan 2008)
New Revision: 3822

Added:
   trunk/scipy/sandbox/dhuard/tests/
   trunk/scipy/sandbox/dhuard/tests/test_histogram.py
   trunk/scipy/sandbox/dhuard/tests/test_stats.py
Removed:
   trunk/scipy/sandbox/dhuard/test_histogram.py
   trunk/scipy/sandbox/dhuard/test_stats.py
   trunk/scipy/tests/
Modified:
   trunk/scipy/__init__.py
   trunk/scipy/cluster/__init__.py
   trunk/scipy/cluster/tests/test_vq.py
   trunk/scipy/fftpack/__init__.py
   trunk/scipy/fftpack/tests/test_basic.py
   trunk/scipy/fftpack/tests/test_helper.py
   trunk/scipy/fftpack/tests/test_pseudo_diffs.py
   trunk/scipy/integrate/__init__.py
   trunk/scipy/integrate/tests/test_integrate.py
   trunk/scipy/integrate/tests/test_quadpack.py
   trunk/scipy/integrate/tests/test_quadrature.py
   trunk/scipy/interpolate/__init__.py
   trunk/scipy/interpolate/tests/test_fitpack.py
   trunk/scipy/interpolate/tests/test_interpolate.py
   trunk/scipy/io/__init__.py
   trunk/scipy/io/matlab/tests/test_mio.py
   trunk/scipy/lib/__init__.py
   trunk/scipy/lib/blas/__init__.py
   trunk/scipy/lib/blas/tests/test_blas.py
   trunk/scipy/lib/blas/tests/test_fblas.py
   trunk/scipy/lib/lapack/__init__.py
   trunk/scipy/lib/lapack/tests/esv_tests.py
   trunk/scipy/lib/lapack/tests/gesv_tests.py
   trunk/scipy/lib/lapack/tests/test_lapack.py
   trunk/scipy/linalg/__init__.py
   trunk/scipy/linalg/tests/test_atlas_version.py
   trunk/scipy/linalg/tests/test_basic.py
   trunk/scipy/linalg/tests/test_blas.py
   trunk/scipy/linalg/tests/test_decomp.py
   trunk/scipy/linalg/tests/test_fblas.py
   trunk/scipy/linalg/tests/test_iterative.py
   trunk/scipy/linalg/tests/test_lapack.py
   trunk/scipy/linalg/tests/test_matfuncs.py
   trunk/scipy/linsolve/__init__.py
   trunk/scipy/linsolve/umfpack/__init__.py
   trunk/scipy/linsolve/umfpack/tests/test_umfpack.py
   trunk/scipy/maxentropy/__init__.py
   trunk/scipy/maxentropy/tests/test_maxentropy.py
   trunk/scipy/misc/__init__.py
   trunk/scipy/misc/ppimport.py
   trunk/scipy/misc/tests/test_pilutil.py
   trunk/scipy/ndimage/__init__.py
   trunk/scipy/ndimage/segment/tests/test_segment.py
   trunk/scipy/ndimage/tests/test_ndimage.py
   trunk/scipy/odr/__init__.py
   trunk/scipy/odr/tests/test_odr.py
   trunk/scipy/optimize/__init__.py
   trunk/scipy/optimize/tests/test_cobyla.py
   trunk/scipy/optimize/tests/test_nonlin.py
   trunk/scipy/optimize/tests/test_optimize.py
   trunk/scipy/optimize/tests/test_slsqp.py
   trunk/scipy/optimize/tests/test_zeros.py
   trunk/scipy/sandbox/arpack/tests/test_arpack.py
   trunk/scipy/sandbox/arpack/tests/test_speigs.py
   trunk/scipy/sandbox/buildgrid/test_build_grid.py
   trunk/scipy/sandbox/cdavid/__init__.py
   trunk/scipy/sandbox/cdavid/segmentaxis.py
   trunk/scipy/sandbox/constants/constants.py
   trunk/scipy/sandbox/delaunay/tests/test_triangulate.py
   trunk/scipy/sandbox/fdfpack/tests/test_fdf.py
   trunk/scipy/sandbox/lobpcg/__init__.py
   trunk/scipy/sandbox/lobpcg/tests/large_scale.py
   trunk/scipy/sandbox/lobpcg/tests/test_lobpcg.py
   trunk/scipy/sandbox/maskedarray/alternative_versions/test_mrecarray.py
   trunk/scipy/sandbox/maskedarray/testutils.py
   trunk/scipy/sandbox/montecarlo/tests/test_dictsampler.py
   trunk/scipy/sandbox/montecarlo/tests/test_intsampler.py
   trunk/scipy/sandbox/multigrid/__init__.py
   trunk/scipy/sandbox/multigrid/simple_test.py
   trunk/scipy/sandbox/multigrid/tests/test_adaptive.py
   trunk/scipy/sandbox/multigrid/tests/test_relaxation.py
   trunk/scipy/sandbox/multigrid/tests/test_sa.py
   trunk/scipy/sandbox/multigrid/tests/test_utils.py
   trunk/scipy/sandbox/numexpr/__init__.py
   trunk/scipy/sandbox/numexpr/compiler.py
   trunk/scipy/sandbox/numexpr/expressions.py
   trunk/scipy/sandbox/numexpr/tests/test_numexpr.py
   trunk/scipy/sandbox/pyloess/mpyloess.py
   trunk/scipy/sandbox/pyloess/tests/test_mpyloess.py
   trunk/scipy/sandbox/pyloess/tests/test_pyloess.py
   trunk/scipy/sandbox/rbf/__init__.py
   trunk/scipy/sandbox/rbf/tests/test_rbf.py
   trunk/scipy/sandbox/spline/__init__.py
   trunk/scipy/sandbox/spline/tests/test_fitpack.py
   trunk/scipy/sandbox/spline/tests/test_spline.py
   trunk/scipy/sandbox/timeseries/dates.py
   trunk/scipy/sandbox/timeseries/extras.py
   trunk/scipy/sandbox/timeseries/lib/filters.py
   trunk/scipy/sandbox/timeseries/lib/interpolate.py
   trunk/scipy/sandbox/timeseries/lib/moving_funcs.py
   trunk/scipy/sandbox/timeseries/lib/tests/test_interpolate.py
   trunk/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py
   trunk/scipy/sandbox/timeseries/report.py
   trunk/scipy/sandbox/timeseries/tests/test_dates.py
   trunk/scipy/sandbox/timeseries/tests/test_extras.py
   trunk/scipy/sandbox/timeseries/tests/test_timeseries.py
   trunk/scipy/sandbox/timeseries/tests/test_trecords.py
   trunk/scipy/sandbox/timeseries/trecords.py
   trunk/scipy/sandbox/timeseries/tseries.py
   trunk/scipy/setup.py
   trunk/scipy/signal/__init__.py
   trunk/scipy/signal/tests/test_signaltools.py
   trunk/scipy/signal/tests/test_wavelets.py
   trunk/scipy/sparse/__init__.py
   trunk/scipy/sparse/tests/test_base.py
   trunk/scipy/sparse/tests/test_construct.py
   trunk/scipy/sparse/tests/test_sparse.py
   trunk/scipy/sparse/tests/test_spfuncs.py
   trunk/scipy/sparse/tests/test_sputils.py
   trunk/scipy/special/__init__.py
   trunk/scipy/special/tests/test_basic.py
   trunk/scipy/special/tests/test_spfun_stats.py
   trunk/scipy/stats/__init__.py
   trunk/scipy/stats/models/__init__.py
   trunk/scipy/stats/models/tests/test_bspline.py
   trunk/scipy/stats/models/tests/test_formula.py
   trunk/scipy/stats/models/tests/test_glm.py
   trunk/scipy/stats/models/tests/test_regression.py
   trunk/scipy/stats/models/tests/test_rlm.py
   trunk/scipy/stats/models/tests/test_scale.py
   trunk/scipy/stats/models/tests/test_utils.py
   trunk/scipy/stats/morestats.py
   trunk/scipy/stats/tests/test_distributions.py
   trunk/scipy/stats/tests/test_morestats.py
   trunk/scipy/stats/tests/test_stats.py
   trunk/scipy/testing/nosetester.py
   trunk/scipy/weave/__init__.py
   trunk/scipy/weave/c_spec.py
   trunk/scipy/weave/size_check.py
   trunk/scipy/weave/tests/test_ast_tools.py
   trunk/scipy/weave/tests/test_blitz_tools.py
   trunk/scipy/weave/tests/test_build_tools.py
   trunk/scipy/weave/tests/test_c_spec.py
   trunk/scipy/weave/tests/test_catalog.py
   trunk/scipy/weave/tests/test_ext_tools.py
   trunk/scipy/weave/tests/test_inline_tools.py
   trunk/scipy/weave/tests/test_numpy_scalar_spec.py
   trunk/scipy/weave/tests/test_scxx.py
   trunk/scipy/weave/tests/test_scxx_dict.py
   trunk/scipy/weave/tests/test_scxx_object.py
   trunk/scipy/weave/tests/test_scxx_sequence.py
   trunk/scipy/weave/tests/test_size_check.py
   trunk/scipy/weave/tests/test_slice_handler.py
   trunk/scipy/weave/tests/test_standard_array_spec.py
   trunk/scipy/weave/tests/test_wx_spec.py
   trunk/scipy/weave/tests/weave_test_utils.py
Log:
Full changeset to implement nose testing

Modified: trunk/scipy/__init__.py
===================================================================
--- trunk/scipy/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -62,14 +62,9 @@
 """
 __doc__ += pkgload.get_pkgdocs()
 
+from testing.pkgtester import Tester
+test = Tester().test
 
-def test(level=1, verbosity=1):
-    """ Run Scipy tests suite with level and verbosity."""
-    from numpy.testing import NumpyTest
-    import scipy
-    scipy.pkgload()
-    return NumpyTest(scipy).test(level, verbosity)
-
 __doc__ += """
 
 Utility tools

Modified: trunk/scipy/cluster/__init__.py
===================================================================
--- trunk/scipy/cluster/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/cluster/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -7,5 +7,5 @@
 __all__ = ['vq']
 
 import vq
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/cluster/tests/test_vq.py
===================================================================
--- trunk/scipy/cluster/tests/test_vq.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/cluster/tests/test_vq.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -7,26 +7,22 @@
 # kmeans works OK for trivial examples.
 
 import sys
-from numpy.testing import *
+import os.path
+from scipy.testing import *
 
 import numpy as N
 
-set_package_path()
-from cluster.vq import kmeans, kmeans2, py_vq, py_vq2, _py_vq_1d, vq, ClusterError
+from scipy.cluster.vq import kmeans, kmeans2, py_vq, py_vq2, _py_vq_1d, vq, ClusterError
 try:
-    from cluster import _vq
+    from scipy.cluster import _vq
     TESTC=True
 except ImportError:
     print "== Error while importing _vq, not testing C imp of vq =="
     TESTC=False
-restore_path()
 
-import os.path
 #Optional:
-set_local_path()
 # import modules that are located in the same directory as this file.
-DATAFILE1 = os.path.join(sys.path[0], "data.txt")
-restore_path()
+DATAFILE1 = os.path.join(os.path.dirname(__file__), "data.txt")
 
 # Global data
 X   = N.array([[3.0, 3], [4, 3], [4, 2],
@@ -43,20 +39,20 @@
 
 LABEL1  = N.array([0, 1, 2, 2, 2, 2, 1, 2, 1, 1, 1])
 
-class TestVq(NumpyTestCase):
-    def check_py_vq(self, level=1):
+class TestVq(TestCase):
+    def test_py_vq(self):
         initc = N.concatenate(([[X[0]], [X[1]], [X[2]]]))
         code = initc.copy()
         label1 = py_vq(X, initc)[0]
         assert_array_equal(label1, LABEL1)
 
-    def check_py_vq2(self, level=1):
+    def test_py_vq2(self):
         initc = N.concatenate(([[X[0]], [X[1]], [X[2]]]))
         code = initc.copy()
         label1 = py_vq2(X, initc)[0]
         assert_array_equal(label1, LABEL1)
 
-    def check_vq(self, level=1):
+    def test_vq(self):
         initc = N.concatenate(([[X[0]], [X[1]], [X[2]]]))
         code = initc.copy()
         if TESTC:
@@ -66,7 +62,7 @@
         else:
             print "== not testing C imp of vq =="
 
-    #def check_py_vq_1d(self, level=1):
+    #def test_py_vq_1d(self):
     #    """Test special rank 1 vq algo, python implementation."""
     #    data = X[:, 0]
     #    initc = data[:3]
@@ -76,7 +72,7 @@
     #    assert_array_equal(a, ta)
     #    assert_array_equal(b, tb)
 
-    def check_vq_1d(self, level=1):
+    def test_vq_1d(self):
         """Test special rank 1 vq algo, python implementation."""
         data = X[:, 0]
         initc = data[:3]
@@ -89,15 +85,15 @@
         else:
             print "== not testing C imp of vq (rank 1) =="
 
-class TestKMean(NumpyTestCase):
-    def check_kmeans_simple(self, level=1):
+class TestKMean(TestCase):
+    def test_kmeans_simple(self):
         initc = N.concatenate(([[X[0]], [X[1]], [X[2]]]))
         code = initc.copy()
         code1 = kmeans(X, code, iter = 1)[0]
 
         assert_array_almost_equal(code1, CODET2)
 
-    def check_kmeans_lost_cluster(self, level=1):
+    def test_kmeans_lost_cluster(self):
         """This will cause kmean to have a cluster with no points."""
         data = N.fromfile(open(DATAFILE1), sep = ", ")
         data = data.reshape((200, 2))
@@ -113,7 +109,7 @@
         except ClusterError, e:
             print "exception raised as expected: " + str(e)
 
-    def check_kmeans2_simple(self, level=1):
+    def test_kmeans2_simple(self):
         """Testing simple call to kmeans2 and its results."""
         initc = N.concatenate(([[X[0]], [X[1]], [X[2]]]))
         code = initc.copy()
@@ -123,7 +119,7 @@
         assert_array_almost_equal(code1, CODET1)
         assert_array_almost_equal(code2, CODET2)
 
-    def check_kmeans2_rank1(self, level=1):
+    def test_kmeans2_rank1(self):
         """Testing simple call to kmeans2 with rank 1 data."""
         data = N.fromfile(open(DATAFILE1), sep = ", ")
         data = data.reshape((200, 2))
@@ -135,7 +131,7 @@
         code1 = kmeans2(data1, code, iter = 1)[0]
         code2 = kmeans2(data1, code, iter = 2)[0]
 
-    def check_kmeans2_init(self, level = 1):
+    def test_kmeans2_init(self):
         """Testing that kmeans2 init methods work."""
         data = N.fromfile(open(DATAFILE1), sep = ", ")
         data = data.reshape((200, 2))
@@ -149,4 +145,4 @@
         kmeans2(data, 3, minit = 'points')
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/fftpack/__init__.py
===================================================================
--- trunk/scipy/fftpack/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/fftpack/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -17,5 +17,5 @@
 del k, register_func
 
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/fftpack/tests/test_basic.py
===================================================================
--- trunk/scipy/fftpack/tests/test_basic.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/fftpack/tests/test_basic.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -6,16 +6,14 @@
 Build fftpack:
   python setup_fftpack.py build
 Run tests if scipy is installed:
-  python -c 'import scipy;scipy.fftpack.test(<level>)'
+  python -c 'import scipy;scipy.fftpack.test()'
 Run tests if fftpack is not installed:
-  python tests/test_basic.py [<level>]
+  python tests/test_basic.py
 """
 import sys
-from numpy.testing import *
-set_package_path()
-from fftpack import ifft,fft,fftn,ifftn,rfft,irfft
-from fftpack import _fftpack as fftpack
-restore_path()
+from scipy.testing import *
+from scipy.fftpack import ifft,fft,fftn,ifftn,rfft,irfft
+from scipy.fftpack import _fftpack as fftpack
 
 from numpy import arange, add, array, asarray, zeros, dot, exp, pi,\
      swapaxes, double, cdouble
@@ -90,9 +88,9 @@
             x1[0] = x[0]
     return direct_idft(x1).real
 
-class TestFft(NumpyTestCase):
+class TestFft(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         x = [1,2,3,4+1j,1,2,3,4+2j]
         y = fft(x)
         y1 = direct_dft(x)
@@ -100,7 +98,7 @@
         x = [1,2,3,4+0j,5]
         assert_array_almost_equal(fft(x),direct_dft(x))
 
-    def check_n_argument_real(self):
+    def test_n_argument_real(self):
         x1 = [1,2,3,4]
         x2 =  [1,2,3,4]
         y = fft([x1,x2],n=4)
@@ -108,7 +106,7 @@
         assert_array_almost_equal(y[0],direct_dft(x1))
         assert_array_almost_equal(y[1],direct_dft(x2))
 
-    def _check_n_argument_complex(self):
+    def _test_n_argument_complex(self):
         x1 = [1,2,3,4+1j]
         x2 =  [1,2,3,4+1j]
         y = fft([x1,x2],n=4)
@@ -116,7 +114,7 @@
         assert_array_almost_equal(y[0],direct_dft(x1))
         assert_array_almost_equal(y[1],direct_dft(x2))
 
-    def check_djbfft(self):
+    def test_djbfft(self):
         for i in range(2,14):
             n = 2**i
             x = range(n)
@@ -126,7 +124,8 @@
             y = fftpack.zrfft(x)
             assert_array_almost_equal(y,y2)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         from numpy.fft import fft as numpy_fft
         print
         print '                 Fast Fourier Transform'
@@ -152,19 +151,19 @@
                 if size > 500: y = fft(x)
                 else: y = direct_dft(x)
                 assert_array_almost_equal(fft(x),y)
-                print '|%8.2f' % self.measure('fft(x)',repeat),
+                print '|%8.2f' % measure('fft(x)',repeat),
                 sys.stdout.flush()
 
                 assert_array_almost_equal(numpy_fft(x),y)
-                print '|%8.2f' % self.measure('numpy_fft(x)',repeat),
+                print '|%8.2f' % measure('numpy_fft(x)',repeat),
                 sys.stdout.flush()
 
             print ' (secs for %s calls)' % (repeat)
         sys.stdout.flush()
 
-class TestIfft(NumpyTestCase):
+class TestIfft(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         x = [1,2,3,4+1j,1,2,3,4+2j]
         y = ifft(x)
         y1 = direct_idft(x)
@@ -178,7 +177,7 @@
         x = [1,2,3,4,5]
         assert_array_almost_equal(ifft(x),direct_idft(x))
 
-    def check_djbfft(self):
+    def test_djbfft(self):
         for i in range(2,14):
             n = 2**i
             x = range(n)
@@ -188,20 +187,21 @@
             y = fftpack.zrfft(x,direction=-1)
             assert_array_almost_equal(y,y2)
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         for size in [1,51,111,100,200,64,128,256,1024]:
             x = random([size]).astype(cdouble)
             x = random([size]).astype(cdouble) +1j*x
             assert_array_almost_equal (ifft(fft(x)),x)
             assert_array_almost_equal (fft(ifft(x)),x)
 
-    def check_random_real(self):
+    def test_random_real(self):
         for size in [1,51,111,100,200,64,128,256,1024]:
             x = random([size]).astype(double)
             assert_array_almost_equal (ifft(fft(x)),x)
             assert_array_almost_equal (fft(ifft(x)),x)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         from numpy.fft import ifft as numpy_ifft
         print
         print '       Inverse Fast Fourier Transform'
@@ -227,19 +227,19 @@
                 if size > 500: y = ifft(x)
                 else: y = direct_idft(x)
                 assert_array_almost_equal(ifft(x),y)
-                print '|%8.2f' % self.measure('ifft(x)',repeat),
+                print '|%8.2f' % measure('ifft(x)',repeat),
                 sys.stdout.flush()
 
                 assert_array_almost_equal(numpy_ifft(x),y)
-                print '|%8.2f' % self.measure('numpy_ifft(x)',repeat),
+                print '|%8.2f' % measure('numpy_ifft(x)',repeat),
                 sys.stdout.flush()
 
             print ' (secs for %s calls)' % (repeat)
         sys.stdout.flush()
 
-class TestRfft(NumpyTestCase):
+class TestRfft(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         x = [1,2,3,4,1,2,3,4]
         y = rfft(x)
         y1 = direct_rdft(x)
@@ -249,7 +249,7 @@
         y1 = direct_rdft(x)
         assert_array_almost_equal(y,y1)
 
-    def check_djbfft(self):
+    def test_djbfft(self):
         from numpy.fft import fft as numpy_fft
         for i in range(2,14):
             n = 2**i
@@ -264,7 +264,8 @@
             y = fftpack.drfft(x)
             assert_array_almost_equal(y,y1)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         from numpy.fft import rfft as numpy_rfft
         print
         print 'Fast Fourier Transform (real data)'
@@ -283,18 +284,18 @@
             sys.stdout.flush()
 
             x = random([size]).astype(double)
-            print '|%8.2f' % self.measure('rfft(x)',repeat),
+            print '|%8.2f' % measure('rfft(x)',repeat),
             sys.stdout.flush()
 
-            print '|%8.2f' % self.measure('numpy_rfft(x)',repeat),
+            print '|%8.2f' % measure('numpy_rfft(x)',repeat),
             sys.stdout.flush()
 
             print ' (secs for %s calls)' % (repeat)
         sys.stdout.flush()
 
-class TestIrfft(NumpyTestCase):
+class TestIrfft(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         x = [1,2,3,4,1,2,3,4]
         x1 = [1,2+3j,4+1j,2+3j,4,2-3j,4-1j,2-3j]
         y = irfft(x)
@@ -308,7 +309,7 @@
         assert_array_almost_equal(y,y1)
         assert_array_almost_equal(y,ifft(x1))
 
-    def check_djbfft(self):
+    def test_djbfft(self):
         from numpy.fft import ifft as numpy_ifft
         for i in range(2,14):
             n = 2**i
@@ -323,13 +324,14 @@
             y = fftpack.drfft(x,direction=-1)
             assert_array_almost_equal(y,y1)
 
-    def check_random_real(self):
+    def test_random_real(self):
         for size in [1,51,111,100,200,64,128,256,1024]:
             x = random([size]).astype(double)
             assert_array_almost_equal (irfft(rfft(x)),x)
             assert_array_almost_equal (rfft(irfft(x)),x)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         from numpy.fft import irfft as numpy_irfft
 
         print
@@ -357,20 +359,20 @@
                 x1[-1] = x[-1]
             y = irfft(x)
 
-            print '|%8.2f' % self.measure('irfft(x)',repeat),
+            print '|%8.2f' % measure('irfft(x)',repeat),
             sys.stdout.flush()
 
             assert_array_almost_equal(numpy_irfft(x1,size),y)
-            print '|%8.2f' % self.measure('numpy_irfft(x1,size)',repeat),
+            print '|%8.2f' % measure('numpy_irfft(x1,size)',repeat),
             sys.stdout.flush()
 
             print ' (secs for %s calls)' % (repeat)
 
         sys.stdout.flush()
 
-class TestFftn(NumpyTestCase):
+class TestFftn(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         x = [[1,2,3],[4,5,6],[7,8,9]]
         y = fftn(x)
         assert_array_almost_equal(y,direct_dftn(x))
@@ -379,7 +381,7 @@
         x = random((5,4,3,20))
         assert_array_almost_equal(fftn(x),direct_dftn(x))
 
-    def check_axes_argument(self):
+    def test_axes_argument(self):
         #plane == ji_plane, x== kji_space
         plane1 = [[1,2,3],[4,5,6],[7,8,9]]
         plane2 = [[10,11,12],[13,14,15],[16,17,18]]
@@ -469,7 +471,7 @@
         y = fftn(x,axes=()) # point
         assert_array_almost_equal(y,x)
 
-    def check_shape_argument(self):
+    def test_shape_argument(self):
         small_x = [[1,2,3],[4,5,6]]
         large_x1 = [[1,2,3,0],[4,5,6,0],[0,0,0,0],[0,0,0,0]]
         y = fftn(small_x,shape=(4,4))
@@ -477,7 +479,7 @@
         y = fftn(small_x,shape=(3,4))
         assert_array_almost_equal (y,fftn(large_x1[:-1]))
 
-    def check_shape_axes_argument(self):
+    def test_shape_axes_argument(self):
         small_x = [[1,2,3],[4,5,6],[7,8,9]]
         large_x1 = array([[1,2,3,0],
                                   [4,5,6,0],
@@ -495,7 +497,8 @@
         assert_array_almost_equal (y,swapaxes(\
             fftn(swapaxes(large_x1,-1,-2)),-1,-2))
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         from numpy.fft import fftn as numpy_fftn
         print
         print '    Multi-dimensional Fast Fourier Transform'
@@ -518,20 +521,20 @@
                 #if size > 500: y = fftn(x)
                 #else: y = direct_dft(x)
                 assert_array_almost_equal(fftn(x),y)
-                print '|%8.2f' % self.measure('fftn(x)',repeat),
+                print '|%8.2f' % measure('fftn(x)',repeat),
                 sys.stdout.flush()
 
                 assert_array_almost_equal(numpy_fftn(x),y)
-                print '|%8.2f' % self.measure('numpy_fftn(x)',repeat),
+                print '|%8.2f' % measure('numpy_fftn(x)',repeat),
                 sys.stdout.flush()
 
             print ' (secs for %s calls)' % (repeat)
 
         sys.stdout.flush()
 
-class TestIfftn(NumpyTestCase):
+class TestIfftn(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         x = [[1,2,3],[4,5,6],[7,8,9]]
         y = ifftn(x)
         assert_array_almost_equal(y,direct_idftn(x))
@@ -540,11 +543,11 @@
         x = random((5,4,3,20))
         assert_array_almost_equal(ifftn(x),direct_idftn(x))
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         for size in [1,2,51,32,64,92]:
             x = random([size,size]) + 1j*random([size,size])
             assert_array_almost_equal (ifftn(fftn(x)),x)
             assert_array_almost_equal (fftn(ifftn(x)),x)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/fftpack/tests/test_helper.py
===================================================================
--- trunk/scipy/fftpack/tests/test_helper.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/fftpack/tests/test_helper.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -12,19 +12,17 @@
 """
 
 import sys
-from numpy.testing import *
-set_package_path()
-from fftpack import fftshift,ifftshift,fftfreq,rfftfreq
-restore_path()
+from scipy.testing import *
+from scipy.fftpack import fftshift,ifftshift,fftfreq,rfftfreq
 
 from numpy import pi
 
 def random(size):
     return rand(*size)
 
-class TestFFTShift(NumpyTestCase):
+class TestFFTShift(TestCase):
 
-    def check_definition(self):
+    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)
@@ -34,14 +32,14 @@
         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):
+class TestFFTFreq(TestCase):
 
-    def check_definition(self):
+    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)
@@ -49,9 +47,9 @@
         assert_array_almost_equal(10*fftfreq(10),x)
         assert_array_almost_equal(10*pi*fftfreq(10,pi),x)
 
-class TestRFFTFreq(NumpyTestCase):
+class TestRFFTFreq(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         x = [0,1,1,2,2,3,3,4,4]
         assert_array_almost_equal(9*rfftfreq(9),x)
         assert_array_almost_equal(9*pi*rfftfreq(9,pi),x)
@@ -60,4 +58,4 @@
         assert_array_almost_equal(10*pi*rfftfreq(10,pi),x)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/fftpack/tests/test_pseudo_diffs.py
===================================================================
--- trunk/scipy/fftpack/tests/test_pseudo_diffs.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/fftpack/tests/test_pseudo_diffs.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -11,12 +11,10 @@
   python tests/test_pseudo_diffs.py [<level>]
 """
 import sys
-from numpy.testing import *
-set_package_path()
-from fftpack import diff,fft,ifft,tilbert,itilbert,hilbert,ihilbert,rfft
-from fftpack import shift
-from fftpack import fftfreq
-restore_path()
+from scipy.testing import *
+from scipy.fftpack import diff,fft,ifft,tilbert,itilbert,hilbert,ihilbert,rfft
+from scipy.fftpack import shift
+from scipy.fftpack import fftfreq
 
 from numpy import arange, add, array, sin, cos, pi,exp,tanh,sum,sign
 
@@ -77,9 +75,9 @@
     return ifft(fft(x)*exp(k*a)).real
 
 
-class TestDiff(NumpyTestCase):
+class TestDiff(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         for n in [16,17,64,127,32]:
             x = arange(n)*2*pi/n
             assert_array_almost_equal(diff(sin(x)),direct_diff(sin(x)))
@@ -100,7 +98,7 @@
                 assert_array_almost_equal(diff(sin(4*x),k),direct_diff(sin(4*x),k))
                 assert_array_almost_equal(diff(cos(4*x),k),direct_diff(cos(4*x),k))
 
-    def check_period(self):
+    def test_period(self):
         for n in [17,64]:
             x = arange(n)/float(n)
             assert_array_almost_equal(diff(sin(2*pi*x),period=1),
@@ -108,7 +106,7 @@
             assert_array_almost_equal(diff(sin(2*pi*x),3,period=1),
                                       -(2*pi)**3*cos(2*pi*x))
 
-    def check_sin(self):
+    def test_sin(self):
         for n in [32,64,77]:
             x = arange(n)*2*pi/n
             assert_array_almost_equal(diff(sin(x)),cos(x))
@@ -118,7 +116,7 @@
             assert_array_almost_equal(diff(sin(4*x)),4*cos(4*x))
             assert_array_almost_equal(diff(sin(sin(x))),cos(x)*cos(sin(x)))
 
-    def check_expr(self):
+    def test_expr(self):
         for n in [64,77,100,128,256,512,1024,2048,4096,8192][:5]:
             x = arange(n)*2*pi/n
             f=sin(x)*cos(4*x)+exp(sin(3*x))
@@ -132,7 +130,7 @@
             assert_array_almost_equal(diff(ddf,-1),df)
             #print max(abs(d1-df))
 
-    def check_expr_large(self):
+    def test_expr_large(self):
         for n in [2048,4096]:
             x = arange(n)*2*pi/n
             f=sin(x)*cos(4*x)+exp(sin(3*x))
@@ -144,7 +142,7 @@
             assert_array_almost_equal(diff(ddf,-1),df)
             assert_array_almost_equal(diff(f,2),ddf)
 
-    def check_int(self):
+    def test_int(self):
         n = 64
         x = arange(n)*2*pi/n
         assert_array_almost_equal(diff(sin(x),-1),-cos(x))
@@ -152,7 +150,7 @@
         assert_array_almost_equal(diff(sin(x),-4),sin(x))
         assert_array_almost_equal(diff(2*cos(2*x),-1),sin(2*x))
 
-    def check_random_even(self):
+    def test_random_even(self):
         for k in [0,2,4,6]:
             for n in [60,32,64,56,55]:
                 f=random ((n,))
@@ -164,7 +162,7 @@
                 assert_array_almost_equal(diff(diff(f,k),-k),f)
                 assert_array_almost_equal(diff(diff(f,-k),k),f)
 
-    def check_random_odd(self):
+    def test_random_odd(self):
         for k in [0,1,2,3,4,5,6]:
             for n in [33,65,55]:
                 f=random ((n,))
@@ -174,7 +172,7 @@
                 assert_array_almost_equal(diff(diff(f,k),-k),f)
                 assert_array_almost_equal(diff(diff(f,-k),k),f)
 
-    def check_zero_nyquist (self):
+    def test_zero_nyquist (self):
         for k in [0,1,2,3,4,5,6]:
             for n in [32,33,64,56,55]:
                 f=random ((n,))
@@ -186,7 +184,8 @@
                 assert_array_almost_equal(diff(diff(f,k),-k),f)
                 assert_array_almost_equal(diff(diff(f,-k),k),f)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         print
         print 'Differentiation of periodic functions'
         print '====================================='
@@ -209,16 +208,16 @@
                 f = sin(x)*cos(4*x)
             assert_array_almost_equal(diff(f,1),direct_diff(f,1))
             assert_array_almost_equal(diff(f,2),direct_diff(f,2))
-            print '| %9.2f' % self.measure('diff(f,3)',repeat),
+            print '| %9.2f' % measure('diff(f,3)',repeat),
             sys.stdout.flush()
-            print '| %9.2f' % self.measure('direct_diff(f,3)',repeat),
+            print '| %9.2f' % measure('direct_diff(f,3)',repeat),
             sys.stdout.flush()
             print ' (secs for %s calls)' % (repeat)
 
 
-class TestTilbert(NumpyTestCase):
+class TestTilbert(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         for h in [0.1,0.5,1,5.5,10]:
             for n in [16,17,64,127]:
                 x = arange(n)*2*pi/n
@@ -230,7 +229,7 @@
                 assert_array_almost_equal(tilbert(sin(2*x),h),
                                           direct_tilbert(sin(2*x),h))
 
-    def check_random_even(self):
+    def test_random_even(self):
         for h in [0.1,0.5,1,5.5,10]:
             for n in [32,64,56]:
                 f=random ((n,))
@@ -239,7 +238,7 @@
                 assert_almost_equal(sum(f,axis=0),0.0)
                 assert_array_almost_equal(direct_tilbert(direct_itilbert(f,h),h),f)
 
-    def check_random_odd(self):
+    def test_random_odd(self):
         for h in [0.1,0.5,1,5.5,10]:
             for n in [33,65,55]:
                 f=random ((n,))
@@ -249,7 +248,8 @@
                 assert_array_almost_equal(itilbert(tilbert(f,h),h),f)
                 assert_array_almost_equal(tilbert(itilbert(f,h),h),f)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         print
         print ' Tilbert transform of periodic functions'
         print '========================================='
@@ -271,15 +271,15 @@
             else:
                 f = sin(x)*cos(4*x)
             assert_array_almost_equal(tilbert(f,1),direct_tilbert(f,1))
-            print '| %9.2f' % self.measure('tilbert(f,1)',repeat),
+            print '| %9.2f' % measure('tilbert(f,1)',repeat),
             sys.stdout.flush()
-            print '| %9.2f' % self.measure('direct_tilbert(f,1)',repeat),
+            print '| %9.2f' % measure('direct_tilbert(f,1)',repeat),
             sys.stdout.flush()
             print ' (secs for %s calls)' % (repeat)
 
-class TestITilbert(NumpyTestCase):
+class TestITilbert(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         for h in [0.1,0.5,1,5.5,10]:
             for n in [16,17,64,127]:
                 x = arange(n)*2*pi/n
@@ -291,9 +291,9 @@
                 assert_array_almost_equal(itilbert(sin(2*x),h),
                                           direct_itilbert(sin(2*x),h))
 
-class TestHilbert(NumpyTestCase):
+class TestHilbert(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         for n in [16,17,64,127]:
             x = arange(n)*2*pi/n
             y = hilbert(sin(x))
@@ -302,7 +302,7 @@
             assert_array_almost_equal(hilbert(sin(2*x)),
                                       direct_hilbert(sin(2*x)))
 
-    def check_tilbert_relation(self):
+    def test_tilbert_relation(self):
         for n in [16,17,64,127]:
             x = arange(n)*2*pi/n
             f = sin (x)+cos (2*x)*sin(x)
@@ -312,7 +312,7 @@
             y2 = tilbert(f,h=10)
             assert_array_almost_equal (y,y2)
 
-    def check_random_odd(self):
+    def test_random_odd(self):
         for n in [33,65,55]:
             f=random ((n,))
             af=sum(f,axis=0)/n
@@ -321,7 +321,7 @@
             assert_array_almost_equal(ihilbert(hilbert(f)),f)
             assert_array_almost_equal(hilbert(ihilbert(f)),f)
 
-    def check_random_even(self):
+    def test_random_even(self):
         for n in [32,64,56]:
             f=random ((n,))
             af=sum(f,axis=0)/n
@@ -332,7 +332,8 @@
             assert_array_almost_equal(direct_hilbert(direct_ihilbert(f)),f)
             assert_array_almost_equal(hilbert(ihilbert(f)),f)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         print
         print ' Hilbert transform of periodic functions'
         print '========================================='
@@ -354,15 +355,15 @@
             else:
                 f = sin(x)*cos(4*x)
             assert_array_almost_equal(hilbert(f),direct_hilbert(f))
-            print '| %9.2f' % self.measure('hilbert(f)',repeat),
+            print '| %9.2f' % measure('hilbert(f)',repeat),
             sys.stdout.flush()
-            print '| %9.2f' % self.measure('direct_hilbert(f)',repeat),
+            print '| %9.2f' % measure('direct_hilbert(f)',repeat),
             sys.stdout.flush()
             print ' (secs for %s calls)' % (repeat)
 
-class TestIHilbert(NumpyTestCase):
+class TestIHilbert(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         for n in [16,17,64,127]:
             x = arange(n)*2*pi/n
             y = ihilbert(sin(x))
@@ -371,7 +372,7 @@
             assert_array_almost_equal(ihilbert(sin(2*x)),
                                       direct_ihilbert(sin(2*x)))
 
-    def check_itilbert_relation(self):
+    def test_itilbert_relation(self):
         for n in [16,17,64,127]:
             x = arange(n)*2*pi/n
             f = sin (x)+cos (2*x)*sin(x)
@@ -381,9 +382,9 @@
             y2 = itilbert(f,h=10)
             assert_array_almost_equal (y,y2)
 
-class TestShift(NumpyTestCase):
+class TestShift(TestCase):
 
-    def check_definition(self):
+    def test_definition(self):
         for n in [18,17,64,127,32,2048,256]:
             x = arange(n)*2*pi/n
             for a in [0.1,3]:
@@ -397,7 +398,8 @@
             assert_array_almost_equal(shift(sin(x),pi),-sin(x))
             assert_array_almost_equal(shift(sin(x),pi/2),cos(x))
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_random(self):
         print
         print ' Shifting periodic functions'
         print '=============================='
@@ -423,11 +425,11 @@
                 sf = sin(x+a)*cos(4*(x+a))
             assert_array_almost_equal(direct_shift(f,1),sf)
             assert_array_almost_equal(shift(f,1),sf)
-            print '| %9.2f' % self.measure('shift(f,a)',repeat),
+            print '| %9.2f' % measure('shift(f,a)',repeat),
             sys.stdout.flush()
-            print '| %9.2f' % self.measure('direct_shift(f,a)',repeat),
+            print '| %9.2f' % measure('direct_shift(f,a)',repeat),
             sys.stdout.flush()
             print ' (secs for %s calls)' % (repeat)
 
 if __name__ == "__main__":
-    NumpyTest('fftpack.pseudo_diffs').run()
+    unittest.main()

Modified: trunk/scipy/integrate/__init__.py
===================================================================
--- trunk/scipy/integrate/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/integrate/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -12,5 +12,5 @@
 from ode import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/integrate/tests/test_integrate.py
===================================================================
--- trunk/scipy/integrate/tests/test_integrate.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/integrate/tests/test_integrate.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -9,12 +9,10 @@
 import numpy
 from numpy import arange, zeros, array, dot, sqrt, cos, sin
 from scipy.linalg import norm
-from numpy.testing import *
-set_package_path()
+from scipy.testing import *
 from scipy.integrate import odeint
-restore_path()
 
-class TestODEInt(NumpyTestCase):
+class TestODEInt(TestCase):
     """ Test odeint: free vibration of a simple oscillator
         m \ddot{u} + k u = 0, u(0) = u_0 \dot{u}(0) \dot{u}_0
 
@@ -32,7 +30,7 @@
         tmp[1,0] = -self.k / self.m
         return dot(tmp,z)
 
-    def check_odeint1(self):
+    def test_odeint1(self):
         omega = sqrt(self.k / self.m)
         z0 = zeros(2, float)
         z0[0] = 1.0     # initial displacement
@@ -51,4 +49,4 @@
         assert res < 1.0e-6
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/integrate/tests/test_quadpack.py
===================================================================
--- trunk/scipy/integrate/tests/test_quadpack.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/integrate/tests/test_quadpack.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,29 +1,27 @@
 import numpy
 from numpy import sqrt, cos, sin, arctan, exp, log, pi, Inf
-from numpy.testing import *
-set_package_path()
+from scipy.testing import *
 from scipy.integrate import quad, dblquad, tplquad
-restore_path()
 
 def assert_quad((value, err), tabledValue, errTol=1.5e-8):
     assert abs(value-tabledValue) < err, (value, tabledValue, err)
     if errTol is not None:
         assert err < errTol, (err, errTol)
 
-class TestQuad(NumpyTestCase):
-    def check_typical(self):
+class TestQuad(TestCase):
+    def test_typical(self):
         # 1) Typical function with two extra arguments:
         def myfunc(x,n,z):       # Bessel function integrand
             return cos(n*x-z*sin(x))/pi
         assert_quad(quad(myfunc,0,pi,(2,1.8)), 0.30614353532540296487)
 
-    def check_indefinite(self):
+    def test_indefinite(self):
         # 2) Infinite integration limits --- Euler's constant
         def myfunc(x):           # Euler's constant integrand
             return -exp(-x)*log(x)
         assert_quad(quad(myfunc,0,Inf), 0.577215664901532860606512)
 
-    def check_singular(self):
+    def test_singular(self):
         # 3) Singular points in region of integration.
         def myfunc(x):
             if x > 0 and x < 2.5:
@@ -36,7 +34,7 @@
         assert_quad(quad(myfunc,0,10,points=[2.5,5.0]),
                     1 - cos(2.5) + exp(-2.5) - exp(-5.0))
 
-    def check_sine_weighted_finite(self):
+    def test_sine_weighted_finite(self):
         # 4) Sine weighted integral (finite limits)
         def myfunc(x,a):
             return exp(a*(x-1))
@@ -45,7 +43,7 @@
         assert_quad(quad(myfunc,0,1,args=20,weight='sin',wvar=ome),
                     (20*sin(ome)-ome*cos(ome)+ome*exp(-20))/(20**2 + ome**2))
 
-    def check_sine_weighted_infinite(self):
+    def test_sine_weighted_infinite(self):
         # 5) Sine weighted integral (infinite limits)
         def myfunc(x,a):
             return exp(-x*a)
@@ -55,7 +53,7 @@
         assert_quad(quad(myfunc,0,Inf,args=a,weight='sin',wvar=ome),
                     ome/(a**2 + ome**2))
 
-    def check_cosine_weighted_infinite(self):
+    def test_cosine_weighted_infinite(self):
         # 6) Cosine weighted integral (negative infinite limits)
         def myfunc(x,a):
             return exp(x*a)
@@ -65,7 +63,7 @@
         assert_quad(quad(myfunc,-Inf,0,args=a,weight='cos',wvar=ome),
                     a/(a**2 + ome**2))
 
-    def check_algebraic_log_weight(self):
+    def test_algebraic_log_weight(self):
         # 6) Algebraic-logarithmic weight.
         def myfunc(x,a):
             return 1/(1+x+2**(-a))
@@ -74,7 +72,7 @@
         assert_quad(quad(myfunc,-1,1,args=a,weight='alg',wvar=(-0.5,-0.5)),
                     pi/sqrt((1+2**(-a))**2 - 1))
 
-    def check_cauchypv_weight(self):
+    def test_cauchypv_weight(self):
         # 7) Cauchy prinicpal value weighting w(x) = 1/(x-c)
         def myfunc(x,a):
             return 2.0**(-a)/((x-1)**2+4.0**(-a))
@@ -85,7 +83,7 @@
         assert_quad(quad(myfunc,0,5,args=0.4,weight='cauchy',wvar=2.0),
                     tabledValue, errTol=1.9e-8)
 
-    def check_double_integral(self):
+    def test_double_integral(self):
         # 8) Double Integral test
         def simpfunc(y,x):       # Note order of arguments.
             return x+y
@@ -94,7 +92,7 @@
         assert_quad(dblquad(simpfunc,a,b,lambda x: x, lambda x: 2*x),
                     5/6.0 * (b**3.0-a**3.0))
 
-    def check_triple_integral(self):
+    def test_triple_integral(self):
         # 9) Triple Integral test
         def simpfunc(z,y,x):      # Note order of arguments.
             return x+y+z
@@ -106,4 +104,4 @@
                     8/3.0 * (b**4.0 - a**4.0))
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/integrate/tests/test_quadrature.py
===================================================================
--- trunk/scipy/integrate/tests/test_quadrature.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/integrate/tests/test_quadrature.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,17 +1,15 @@
 
 import numpy
 from numpy import cos, sin, pi
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
 from scipy.integrate import quadrature, romberg, romb
-restore_path()
 
-class TestQuadrature(NumpyTestCase):
+class TestQuadrature(TestCase):
     def quad(self, x, a, b, args):
         raise NotImplementedError
 
-    def check_quadrature(self):
+    def test_quadrature(self):
         # Typical function with two extra arguments:
         def myfunc(x,n,z):       # Bessel function integrand
             return cos(n*x-z*sin(x))/pi
@@ -19,7 +17,7 @@
         table_val = 0.30614353532540296487
         assert_almost_equal(val, table_val, decimal=7)
 
-    def check_romberg(self):
+    def test_romberg(self):
         # Typical function with two extra arguments:
         def myfunc(x, n, z):       # Bessel function integrand
             return cos(n*x-z*sin(x))/pi
@@ -27,8 +25,8 @@
         table_val = 0.30614353532540296487
         assert_almost_equal(val, table_val, decimal=7)
 
-    def check_romb(self):
+    def test_romb(self):
         assert_equal(romb(numpy.arange(17)),128)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/interpolate/__init__.py
===================================================================
--- trunk/scipy/interpolate/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/interpolate/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -11,5 +11,5 @@
 from fitpack2 import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/interpolate/tests/test_fitpack.py
===================================================================
--- trunk/scipy/interpolate/tests/test_fitpack.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/interpolate/tests/test_fitpack.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -13,17 +13,15 @@
 #import libwadpy
 
 import sys
-from numpy.testing import *
+from scipy.testing import *
 from numpy import array
-set_package_path()
-from interpolate.fitpack2 import UnivariateSpline,LSQUnivariateSpline,\
+from scipy.interpolate.fitpack2 import UnivariateSpline,LSQUnivariateSpline,\
      InterpolatedUnivariateSpline
-from interpolate.fitpack2 import LSQBivariateSpline, SmoothBivariateSpline,\
-     RectBivariateSpline
-restore_path()
+from scipy.interpolate.fitpack2 import LSQBivariateSpline, \
+     SmoothBivariateSpline, RectBivariateSpline
 
-class TestUnivariateSpline(NumpyTestCase):
-    def check_linear_constant(self):
+class TestUnivariateSpline(TestCase):
+    def test_linear_constant(self):
         x = [1,2,3]
         y = [3,3,3]
         lut = UnivariateSpline(x,y,k=1)
@@ -32,7 +30,7 @@
         assert_almost_equal(lut.get_residual(),0.0)
         assert_array_almost_equal(lut([1,1.5,2]),[3,3,3])
 
-    def check_linear_1d(self):
+    def test_linear_1d(self):
         x = [1,2,3]
         y = [0,2,4]
         lut = UnivariateSpline(x,y,k=1)
@@ -41,8 +39,8 @@
         assert_almost_equal(lut.get_residual(),0.0)
         assert_array_almost_equal(lut([1,1.5,2]),[0,1,2])
 
-class TestLSQBivariateSpline(NumpyTestCase):
-    def check_linear_constant(self):
+class TestLSQBivariateSpline(TestCase):
+    def test_linear_constant(self):
         x = [1,1,1,2,2,2,3,3,3]
         y = [1,2,3,1,2,3,1,2,3]
         z = [3,3,3,3,3,3,3,3,3]
@@ -54,8 +52,8 @@
         #print lut.get_coeffs()
         #print lut.get_residual()
 
-class TestSmoothBivariateSpline(NumpyTestCase):
-    def check_linear_constant(self):
+class TestSmoothBivariateSpline(TestCase):
+    def test_linear_constant(self):
         x = [1,1,1,2,2,2,3,3,3]
         y = [1,2,3,1,2,3,1,2,3]
         z = [3,3,3,3,3,3,3,3,3]
@@ -65,7 +63,7 @@
         assert_almost_equal(lut.get_residual(),0.0)
         assert_array_almost_equal(lut([1,1.5,2],[1,1.5]),[[3,3],[3,3],[3,3]])
 
-    def check_linear_1d(self):
+    def test_linear_1d(self):
         x = [1,1,1,2,2,2,3,3,3]
         y = [1,2,3,1,2,3,1,2,3]
         z = [0,0,0,2,2,2,4,4,4]
@@ -75,8 +73,8 @@
         assert_almost_equal(lut.get_residual(),0.0)
         assert_array_almost_equal(lut([1,1.5,2],[1,1.5]),[[0,0],[1,1],[2,2]])
 
-class TestRectBivariateSpline(NumpyTestCase):
-    def check_defaults(self):
+class TestRectBivariateSpline(TestCase):
+    def test_defaults(self):
         x = array([1,2,3,4,5])
         y = array([1,2,3,4,5])
         z = array([[1,2,1,2,1],[1,2,1,2,1],[1,2,3,2,1],[1,2,2,2,1],[1,2,1,2,1]])
@@ -84,4 +82,4 @@
         assert_array_almost_equal(lut(x,y),z)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/interpolate/tests/test_interpolate.py
===================================================================
--- trunk/scipy/interpolate/tests/test_interpolate.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/interpolate/tests/test_interpolate.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,13 +1,11 @@
-from numpy.testing import *
+from scipy.testing import *
 from numpy import mgrid, pi, sin, ogrid
 import numpy as np
 
-set_package_path()
-from interpolate import interp1d, interp2d
-restore_path()
+from scipy.interpolate import interp1d, interp2d
 
 
-class TestInterp2D(NumpyTestCase):
+class TestInterp2D(TestCase):
     def test_interp2d(self):
         y, x = mgrid[0:pi:20j, 0:pi:21j]
         z = sin(x+y)
@@ -18,7 +16,7 @@
         assert_almost_equal(I(u.ravel(), v.ravel()), sin(v+u), decimal=2)
 
 
-class TestInterp1D(NumpyTestCase):
+class TestInterp1D(TestCase):
 
     def setUp(self):
         self.x10 = np.arange(10.)
@@ -202,4 +200,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/io/__init__.py
===================================================================
--- trunk/scipy/io/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/io/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -83,8 +83,6 @@
 from data_store import save_as_module
 from mmio import mminfo, mmread, mmwrite
 
-
-
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/io/matlab/tests/test_mio.py
===================================================================
--- trunk/scipy/io/matlab/tests/test_mio.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/io/matlab/tests/test_mio.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,248 +1,242 @@
 #!/usr/bin/env python
-
+''' Nose test generators '''
 import os
 from glob import glob
 from cStringIO import StringIO
 from tempfile import mkstemp
-from numpy.testing import set_package_path, restore_path, NumpyTestCase, NumpyTest
-from numpy.testing import assert_equal, assert_array_almost_equal
+from scipy.testing import *
 from numpy import arange, array, eye, pi, cos, exp, sin, sqrt, ndarray,  \
      zeros, reshape, transpose, empty
 import scipy.sparse as SP
 
-set_package_path()
-from matlab.mio import loadmat, savemat
-from matlab.mio5 import mat_obj, mat_struct
-restore_path()
+from scipy.io.matlab.mio import loadmat, savemat
+from scipy.io.matlab.mio5 import mat_obj, mat_struct
 
 try:  # Python 2.3 support
     from sets import Set as set
 except:
     pass
 
-test_data_path = os.path.join(os.path.dirname(__file__), './data')
+test_data_path = os.path.join(os.path.dirname(__file__), 'data')
 
-class TestMIOArray(NumpyTestCase):
-    def __init__(self, *args, **kwargs):
-        super(TestMIOArray, self).__init__(*args, **kwargs)
+def _check_level(self, label, expected, actual):
+    """ Check one level of a potentially nested object / list """
+    # object array is returned from cell array in mat file
+    typex = type(expected)
+    typac = type(actual)
+    if isinstance(expected, ndarray) and expected.dtype.hasobject:
+        assert typex is typac, "Different types at %s" % label
+        assert len(expected) == len(actual), "Different list lengths at %s" % label
+        for i, ev in enumerate(expected):
+            level_label = "%s, [%d], " % (label, i)
+            self._check_level(level_label, ev, actual[i])
+        return
+    # object, as container for matlab structs and objects
+    elif isinstance(expected, mat_struct) or isinstance(expected, mat_obj):
+        assert isinstance(actual, typex), \
+               "Different types %s and %s at %s" % (typex, typac, label)
+        ex_fields = dir(expected)
+        ac_fields = dir(actual)
+        for k in ex_fields:
+            if k.startswith('__') and k.endswith('__'):
+                continue
+            assert k in ac_fields, "Missing property at %s" % label
+            ev = expected.__dict__[k]
+            v = actual.__dict__[k]
+            level_label = "%s, property %s, " % (label, k)
+            self._check_level(level_label, ev, v)
+        return
+    # hoping this is a single value, which might be an array
+    if SP.issparse(expected):
+        assert SP.issparse(actual), "Expected sparse at %s" % label
+        assert_array_almost_equal(actual.todense(),
+                                  expected.todense(),
+                                  err_msg = label,
+                                  decimal = 5)
+    elif isinstance(expected, ndarray):
+        if expected.shape: # allow scalar and 0d array comparisons
+            assert isinstance(actual, ndarray), "Expected ndarray at %s" % label
+        assert_array_almost_equal(actual, expected, err_msg=label, decimal=5)
+    else:
+        assert isinstance(expected, typac), \
+               "Types %s and %s do not match at %s" % (typex, typac, label)
+        assert_equal(actual, expected, err_msg=label)
 
-    def _check_level(self, label, expected, actual):
-        """ Check one level of a potentially nested object / list """
-        # object array is returned from cell array in mat file
-        typex = type(expected)
-        typac = type(actual)
-        if isinstance(expected, ndarray) and expected.dtype.hasobject:
-            assert typex is typac, "Different types at %s" % label
-            assert len(expected) == len(actual), "Different list lengths at %s" % label
-            for i, ev in enumerate(expected):
-                level_label = "%s, [%d], " % (label, i)
-                self._check_level(level_label, ev, actual[i])
-            return
-        # object, as container for matlab structs and objects
-        elif isinstance(expected, mat_struct) or isinstance(expected, mat_obj):
-            assert isinstance(actual, typex), \
-                   "Different types %s and %s at %s" % (typex, typac, label)
-            ex_fields = dir(expected)
-            ac_fields = dir(actual)
-            for k in ex_fields:
-                if k.startswith('__') and k.endswith('__'):
-                    continue
-                assert k in ac_fields, "Missing property at %s" % label
-                ev = expected.__dict__[k]
-                v = actual.__dict__[k]
-                level_label = "%s, property %s, " % (label, k)
-                self._check_level(level_label, ev, v)
-            return
-        # hoping this is a single value, which might be an array
-        if SP.issparse(expected):
-            assert SP.issparse(actual), "Expected sparse at %s" % label
-            assert_array_almost_equal(actual.todense(),
-                                      expected.todense(),
-                                      err_msg = label,
-                                      decimal = 5)
-        elif isinstance(expected, ndarray):
-            if expected.shape: # allow scalar and 0d array comparisons
-                assert isinstance(actual, ndarray), "Expected ndarray at %s" % label
-            assert_array_almost_equal(actual, expected, err_msg=label, decimal=5)
-        else:
-            assert isinstance(expected, typac), \
-                   "Types %s and %s do not match at %s" % (typex, typac, label)
-            assert_equal(actual, expected, err_msg=label)
+def _check_case(self, name, files, case):
+    for file_name in files:
+        matdict = loadmat(file_name)
+        label = "test %s; file %s" % (name, file_name)
+        for k, expected in case.items():
+            k_label = "%s, variable %s" % (label, k)
+            assert k in matdict, "Missing key at %s" % k_label
+            self._check_level(k_label, expected, matdict[k])
 
-    def _check_case(self, name, files, case):
-        for file_name in files:
-            matdict = loadmat(file_name)
-            label = "test %s; file %s" % (name, file_name)
-            for k, expected in case.items():
-                k_label = "%s, variable %s" % (label, k)
-                assert k in matdict, "Missing key at %s" % k_label
-                self._check_level(k_label, expected, matdict[k])
+# Add the load tests dynamically, with given parameters
+def _make_check_case(name, files, expected):
+    def cc(self):
+        self._check_case(name, files, expected)
+    cc.__doc__ = "check loadmat case %s" % name
+    return cc
 
-    # Add the load tests dynamically, with given parameters
-    def _make_check_case(name, files, expected):
-        def cc(self):
-            self._check_case(name, files, expected)
-        cc.__doc__ = "check loadmat case %s" % name
-        return cc
+# Add the round trip tests dynamically, with given parameters
+def _make_rt_check_case(name, expected, format):
+    def cc(self):
+        mat_stream = StringIO()
+        savemat(mat_stream, expected, format=format)
+        mat_stream.seek(0)
+        self._check_case(name, [mat_stream], expected)
+    cc.__doc__ = "check loadmat case %s" % name
+    return cc
 
-    # Add the round trip tests dynamically, with given parameters
-    def _make_rt_check_case(name, expected, format):
-        def cc(self):
-            mat_stream = StringIO()
-            savemat(mat_stream, expected, format=format)
-            mat_stream.seek(0)
-            self._check_case(name, [mat_stream], expected)
-        cc.__doc__ = "check loadmat case %s" % name
-        return cc
+# Define cases to test
+theta = pi/4*arange(9,dtype=float)
+case_table4 = [
+    {'name': 'double',
+     'expected': {'testdouble': theta}
+     }]
+case_table4.append(
+    {'name': 'string',
+     'expected': {'teststring': u'"Do nine men interpret?" "Nine men," I nod.'},
+     })
+case_table4.append(
+    {'name': 'complex',
+     'expected': {'testcomplex': cos(theta) + 1j*sin(theta)}
+     })
+A = zeros((3,5))
+A[0] = range(1,6)
+A[:,0] = range(1,4)
+case_table4.append(
+    {'name': 'matrix',
+     'expected': {'testmatrix': A},
+     })
+case_table4.append(
+    {'name': 'sparse',
+     'expected': {'testsparse': SP.csc_matrix(A)},
+     })
+B = A.astype(complex)
+B[0,0] += 1j
+case_table4.append(
+    {'name': 'sparsecomplex',
+     'expected': {'testsparsecomplex': SP.csc_matrix(B)},
+     })
+case_table4.append(
+    {'name': 'multi',
+     'expected': {'theta': theta,
+                  'a': A},
+     })
+case_table4.append(
+    {'name': 'minus',
+     'expected': {'testminus': array(-1)},
+     })
+case_table4.append(
+    {'name': 'onechar',
+     'expected': {'testonechar': u'r'},
+     })
+case_table5 = [
+    {'name': 'cell',
+     'expected': {'testcell':
+                  array([u'This cell contains this string and 3 arrays of '+\
+                         'increasing length',
+                         array(1), array([1,2]), array([1,2,3])],
+                        dtype=object)}
+     }]
+case_table5.append(
+    {'name': 'emptycell',
+     'expected': {'testemptycell':
+                  array([array(1), array(2), array([]),
+                         array([]), array(3)], dtype=object)}
+     })
+case_table5.append(
+    {'name': 'stringarray',
+     'expected': {'teststringarray': array(
+    [u'one  ', u'two  ', u'three'], dtype=object)},
+     })
+case_table5.append(
+    {'name': '3dmatrix',
+     'expected': {'test3dmatrix': transpose(reshape(range(1,25), (4,3,2)))}
+     })
+case_table5_rt = [
+    {'name': '3dmatrix',
+     'expected': {'test3dmatrix': transpose(reshape(range(1,25), (4,3,2)))}
+     },
+    {'name': 'sparsefloat',
+     'expected': {'testsparsefloat': SP.csc_matrix(array([[1,0,2],[0,-3.5,0]]))},
+     },
+    {'name': 'sparsecomplex',
+     'expected': {'testsparsefloat': SP.csc_matrix(array([[-1+2j,0,2],[0,-3j,0]]))},
+     },
+    ]
+st = mat_struct()
+st.stringfield = u'Rats live on no evil star.'
+st.doublefield = array([sqrt(2),exp(1),pi])
+st.complexfield = (1+1j)*array([sqrt(2),exp(1),pi])
+case_table5.append(
+    {'name': 'struct',
+     'expected': {'teststruct': st}
+     })
+a = array([array(1),
+           array([array(2), array(3),
+                  array([array(4), array(5)],
+                        dtype=object)],
+                 dtype=object)],
+          dtype=object)
+case_table5.append(
+    {'name': 'cellnest',
+     'expected': {'testcellnest': a},
+     })
+st = mat_struct()
+st.one = array(1)
+st.two = mat_struct()
+st.two.three = u'number 3'
+case_table5.append(
+    {'name': 'structnest',
+     'expected': {'teststructnest': st}
+     })
+a = array([mat_struct(), mat_struct()])
+a[0].one = array(1)
+a[0].two = array(2)
+a[1].one = u'number 1'
+a[1].two = u'number 2'
+case_table5.append(
+    {'name': 'structarr',
+     'expected': {'teststructarr': a}
+     })
+a = mat_obj()
+a._classname = 'inline'
+a.expr = u'x'
+a.inputExpr = u' x = INLINE_INPUTS_{1};'
+a.args = u'x'
+a.isEmpty = array(0)
+a.numArgs = array(1)
+a.version = array(1)
+case_table5.append(
+    {'name': 'object',
+     'expected': {'testobject': a}
+     })
+u_str = file(
+    os.path.join(test_data_path, 'japanese_utf8.txt'),
+    'rb').read().decode('utf-8')
+case_table5.append(
+    {'name': 'unicode',
+    'expected': {'testunicode': u_str}
+    })
 
-    # Define cases to test
-    theta = pi/4*arange(9,dtype=float)
-    case_table4 = [
-        {'name': 'double',
-         'expected': {'testdouble': theta}
-         }]
-    case_table4.append(
-        {'name': 'string',
-         'expected': {'teststring': u'"Do nine men interpret?" "Nine men," I nod.'},
-         })
-    case_table4.append(
-        {'name': 'complex',
-         'expected': {'testcomplex': cos(theta) + 1j*sin(theta)}
-         })
-    A = zeros((3,5))
-    A[0] = range(1,6)
-    A[:,0] = range(1,4)
-    case_table4.append(
-        {'name': 'matrix',
-         'expected': {'testmatrix': A},
-         })
-    case_table4.append(
-        {'name': 'sparse',
-         'expected': {'testsparse': SP.csc_matrix(A)},
-         })
-    B = A.astype(complex)
-    B[0,0] += 1j
-    case_table4.append(
-        {'name': 'sparsecomplex',
-         'expected': {'testsparsecomplex': SP.csc_matrix(B)},
-         })
-    case_table4.append(
-        {'name': 'multi',
-         'expected': {'theta': theta,
-                      'a': A},
-         })
-    case_table4.append(
-        {'name': 'minus',
-         'expected': {'testminus': array(-1)},
-         })
-    case_table4.append(
-        {'name': 'onechar',
-         'expected': {'testonechar': u'r'},
-         })
-    case_table5 = [
-        {'name': 'cell',
-         'expected': {'testcell':
-                      array([u'This cell contains this string and 3 arrays of '+\
-                             'increasing length',
-                             array(1), array([1,2]), array([1,2,3])],
-                            dtype=object)}
-         }]
-    case_table5.append(
-        {'name': 'emptycell',
-         'expected': {'testemptycell':
-                      array([array(1), array(2), array([]),
-                             array([]), array(3)], dtype=object)}
-         })
-    case_table5.append(
-        {'name': 'stringarray',
-         'expected': {'teststringarray': array(
-        [u'one  ', u'two  ', u'three'], dtype=object)},
-         })
-    case_table5.append(
-        {'name': '3dmatrix',
-         'expected': {'test3dmatrix': transpose(reshape(range(1,25), (4,3,2)))}
-         })
-    case_table5_rt = [
-        {'name': '3dmatrix',
-         'expected': {'test3dmatrix': transpose(reshape(range(1,25), (4,3,2)))}
-         },
-        {'name': 'sparsefloat',
-         'expected': {'testsparsefloat': SP.csc_matrix(array([[1,0,2],[0,-3.5,0]]))},
-         },
-        {'name': 'sparsecomplex',
-         'expected': {'testsparsefloat': SP.csc_matrix(array([[-1+2j,0,2],[0,-3j,0]]))},
-         },
-        ]
-    st = mat_struct()
-    st.stringfield = u'Rats live on no evil star.'
-    st.doublefield = array([sqrt(2),exp(1),pi])
-    st.complexfield = (1+1j)*array([sqrt(2),exp(1),pi])
-    case_table5.append(
-        {'name': 'struct',
-         'expected': {'teststruct': st}
-         })
-    a = array([array(1),
-               array([array(2), array(3),
-                      array([array(4), array(5)],
-                            dtype=object)],
-                     dtype=object)],
-              dtype=object)
-    case_table5.append(
-        {'name': 'cellnest',
-         'expected': {'testcellnest': a},
-         })
-    st = mat_struct()
-    st.one = array(1)
-    st.two = mat_struct()
-    st.two.three = u'number 3'
-    case_table5.append(
-        {'name': 'structnest',
-         'expected': {'teststructnest': st}
-         })
-    a = array([mat_struct(), mat_struct()])
-    a[0].one = array(1)
-    a[0].two = array(2)
-    a[1].one = u'number 1'
-    a[1].two = u'number 2'
-    case_table5.append(
-        {'name': 'structarr',
-         'expected': {'teststructarr': a}
-         })
-    a = mat_obj()
-    a._classname = 'inline'
-    a.expr = u'x'
-    a.inputExpr = u' x = INLINE_INPUTS_{1};'
-    a.args = u'x'
-    a.isEmpty = array(0)
-    a.numArgs = array(1)
-    a.version = array(1)
-    case_table5.append(
-        {'name': 'object',
-         'expected': {'testobject': a}
-         })
-    u_str = file(
-        os.path.join(test_data_path, 'japanese_utf8.txt'),
-        'rb').read().decode('utf-8')
-    case_table5.append(
-        {'name': 'unicode',
-        'expected': {'testunicode': u_str}
-        })
-    # add load tests
+# generator for load tests
+def test_load():
     for case in case_table4 + case_table5:
         name = case['name']
         expected = case['expected']
         filt = os.path.join(test_data_path, 'test%s_*.mat' % name)
         files = glob(filt)
         assert files, "No files for test %s using filter %s" % (name, filt)
-        exec 'check_%s = _make_check_case(name, files, expected)' % name
+        yield _make_check_case, name, files, expected
+
     # round trip tests
+def test_round_trip():
     for case in case_table4 + case_table5_rt:
         name = case['name'] + '_round_trip'
         expected = case['expected']
         format = case in case_table4 and '4' or '5'
-        exec 'check_%s = _make_rt_check_case(name, expected, format)' \
-             % name
+        yield _make_rt_check_case, name, expected, format
 
 
-if __name__ == "__main__":
-    NumpyTest().run()

Modified: trunk/scipy/lib/__init__.py
===================================================================
--- trunk/scipy/lib/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/lib/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,5 +1,5 @@
 
 from info import __doc__, __all__
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/lib/blas/__init__.py
===================================================================
--- trunk/scipy/lib/blas/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/lib/blas/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -58,5 +58,5 @@
         funcs.append(func)
     return tuple(funcs)
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/lib/blas/tests/test_blas.py
===================================================================
--- trunk/scipy/lib/blas/tests/test_blas.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/lib/blas/tests/test_blas.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -12,21 +12,18 @@
   python tests/test_blas.py [<level>]
 """
 
+import sys
+import math
 
 from numpy import arange, add, array
-import math
+from scipy.testing import *
+from scipy.lib.blas import fblas
+from scipy.lib.blas import cblas
+from scipy.lib.blas import get_blas_funcs
 
-import sys
-from numpy.testing import *
-set_package_path()
-from blas import fblas
-from blas import cblas
-from blas import get_blas_funcs
-restore_path()
+class TestCBLAS1Simple(TestCase):
 
-class TestCBLAS1Simple(NumpyTestCase):
-
-    def check_axpy(self):
+    def test_axpy(self):
         for p in 'sd':
             f = getattr(cblas,p+'axpy',None)
             if f is None: continue
@@ -36,9 +33,9 @@
             if f is None: continue
             assert_array_almost_equal(f([1,2j,3],[2,-1,3],a=5),[7,10j-1,18])
 
-class TestFBLAS1Simple(NumpyTestCase):
+class TestFBLAS1Simple(TestCase):
 
-    def check_axpy(self):
+    def test_axpy(self):
         for p in 'sd':
             f = getattr(fblas,p+'axpy',None)
             if f is None: continue
@@ -47,7 +44,7 @@
             f = getattr(fblas,p+'axpy',None)
             if f is None: continue
             assert_array_almost_equal(f([1,2j,3],[2,-1,3],a=5),[7,10j-1,18])
-    def check_copy(self):
+    def test_copy(self):
         for p in 'sd':
             f = getattr(fblas,p+'copy',None)
             if f is None: continue
@@ -56,7 +53,7 @@
             f = getattr(fblas,p+'copy',None)
             if f is None: continue
             assert_array_almost_equal(f([3,4j,5+3j],[8]*3),[3,4j,5+3j])
-    def check_asum(self):
+    def test_asum(self):
         for p in 'sd':
             f = getattr(fblas,p+'asum',None)
             if f is None: continue
@@ -65,7 +62,7 @@
             f = getattr(fblas,p+'asum',None)
             if f is None: continue
             assert_almost_equal(f([3j,-4,3-4j]),14)
-    def check_dot(self):
+    def test_dot(self):
         for p in 'sd':
             f = getattr(fblas,p+'dot',None)
             if f is None: continue
@@ -76,7 +73,7 @@
             assert_almost_equal(f([3j,-4,3-4j],[2,3,1]),-9+2j)
             f = getattr(fblas,p+'dotc')
             assert_almost_equal(f([3j,-4,3-4j],[2,3j,1]),3-14j)
-    def check_nrm2(self):
+    def test_nrm2(self):
         for p in 'sd':
             f = getattr(fblas,p+'nrm2',None)
             if f is None: continue
@@ -85,7 +82,7 @@
             f = getattr(fblas,p+'nrm2',None)
             if f is None: continue
             assert_almost_equal(f([3j,-4,3-4j]),math.sqrt(50))
-    def check_scal(self):
+    def test_scal(self):
         for p in 'sd':
             f = getattr(fblas,p+'scal',None)
             if f is None: continue
@@ -98,7 +95,7 @@
             f = getattr(fblas,p+'scal',None)
             if f is None: continue
             assert_array_almost_equal(f(3,[3j,-4,3-4j]),[9j,-12,9-12j])
-    def check_swap(self):
+    def test_swap(self):
         for p in 'sd':
             f = getattr(fblas,p+'swap',None)
             if f is None: continue
@@ -113,7 +110,7 @@
             x1,y1 = f(x,y)
             assert_array_almost_equal(x1,y)
             assert_array_almost_equal(y1,x)
-    def check_amax(self):
+    def test_amax(self):
         for p in 'sd':
             f = getattr(fblas,'i'+p+'amax')
             assert_equal(f([-2,4,3]),1)
@@ -122,9 +119,9 @@
             assert_equal(f([-5,4+3j,6]),1)
     #XXX: need tests for rot,rotm,rotg,rotmg
 
-class TestFBLAS2Simple(NumpyTestCase):
+class TestFBLAS2Simple(TestCase):
 
-    def check_gemv(self):
+    def test_gemv(self):
         for p in 'sd':
             f = getattr(fblas,p+'gemv',None)
             if f is None: continue
@@ -136,7 +133,7 @@
             assert_array_almost_equal(f(3j,[[3-4j]],[-4]),[-48-36j])
             assert_array_almost_equal(f(3j,[[3-4j]],[-4],3,[5j]),[-48-21j])
 
-    def check_ger(self):
+    def test_ger(self):
 
         for p in 'sd':
             f = getattr(fblas,p+'ger',None)
@@ -170,9 +167,9 @@
                                            2j,
                                            3j],[3j,4j]),[[6,8],[12,16],[18,24]])
 
-class TestFBLAS3Simple(NumpyTestCase):
+class TestFBLAS3Simple(TestCase):
 
-    def check_gemm(self):
+    def test_gemm(self):
         for p in 'sd':
             f = getattr(fblas,p+'gemm',None)
             if f is None: continue
@@ -188,22 +185,22 @@
             assert_array_almost_equal(f(1,[[1,2],[1,2]],[[3],[4]]),[[11],[11]])
             assert_array_almost_equal(f(1,[[1,2]],[[3,3],[4,4]]),[[11,11]])
 
-    def check_gemm2(self):
+    def test_gemm2(self):
         for p in 'sdcz':
             f = getattr(fblas,p+'gemm',None)
             if f is None: continue
             assert_array_almost_equal(f(1,[[1,2]],[[3],[4]]),[[11]])
             assert_array_almost_equal(f(1,[[1,2],[1,2]],[[3],[4]]),[[11],[11]])
 
-class TestBLAS(NumpyTestCase):
+class TestBLAS(TestCase):
 
-    def check_blas(self):
+    def test_blas(self):
         a = array([[1,1,1]])
         b = array([[1],[1],[1]])
         gemm, = get_blas_funcs(('gemm',),(a,b))
         assert_array_almost_equal(gemm(1,a,b),[[3]],15)
 
-    def check_fblas(self):
+    def test_fblas(self):
         if hasattr(fblas,'empty_module'):
             print """
 ****************************************************************
@@ -212,7 +209,7 @@
 See scipy/INSTALL.txt for troubleshooting.
 ****************************************************************
 """
-    def check_cblas(self):
+    def test_cblas(self):
         if hasattr(cblas,'empty_module'):
             print """
 ****************************************************************
@@ -226,4 +223,4 @@
 """
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/lib/blas/tests/test_fblas.py
===================================================================
--- trunk/scipy/lib/blas/tests/test_fblas.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/lib/blas/tests/test_fblas.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -6,13 +6,12 @@
 # !! Complex calculations really aren't checked that carefully.
 # !! Only real valued complex numbers are used in tests.
 
-from numpy import *
-
 import sys
-from numpy.testing import *
-set_package_path()
-from blas import fblas
-restore_path()
+from numpy import zeros, transpose, newaxis, shape, float32, \
+     float64, complex64, complex128, arange, array, common_type, \
+     conjugate
+from scipy.testing import *
+from scipy.lib.blas import fblas
 
 #decimal accuracy to require between Python and LAPACK/BLAS calculations
 accuracy = 5
@@ -40,39 +39,40 @@
 ##################################################
 ### Test blas ?axpy
 
-class BaseAxpy(NumpyTestCase):
-    def check_default_a(self):
+class BaseAxpy(object):
+    # Mixin class to test dtypes
+    def test_default_a(self):
         x = arange(3.,dtype=self.dtype)
         y = arange(3.,dtype=x.dtype)
         real_y = x*1.+y
         self.blas_func(x,y)
         assert_array_almost_equal(real_y,y)
-    def check_simple(self):
+    def test_simple(self):
         x = arange(3.,dtype=self.dtype)
         y = arange(3.,dtype=x.dtype)
         real_y = x*3.+y
         self.blas_func(x,y,a=3.)
         assert_array_almost_equal(real_y,y)
-    def check_x_stride(self):
+    def test_x_stride(self):
         x = arange(6.,dtype=self.dtype)
         y = zeros(3,x.dtype)
         y = arange(3.,dtype=x.dtype)
         real_y = x[::2]*3.+y
         self.blas_func(x,y,a=3.,n=3,incx=2)
         assert_array_almost_equal(real_y,y)
-    def check_y_stride(self):
+    def test_y_stride(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         real_y = x*3.+y[::2]
         self.blas_func(x,y,a=3.,n=3,incy=2)
         assert_array_almost_equal(real_y,y[::2])
-    def check_x_and_y_stride(self):
+    def test_x_and_y_stride(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         real_y = x[::4]*3.+y[::2]
         self.blas_func(x,y,a=3.,n=3,incx=4,incy=2)
         assert_array_almost_equal(real_y,y[::2])
-    def check_x_bad_size(self):
+    def test_x_bad_size(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         try:
@@ -81,7 +81,7 @@
             return
         # should catch error and never get here
         assert(0)
-    def check_y_bad_size(self):
+    def test_y_bad_size(self):
         x = arange(12.,dtype=complex64)
         y = zeros(6,x.dtype)
         try:
@@ -92,21 +92,21 @@
         assert(0)
 
 try:
-    class TestSaxpy(BaseAxpy):
+    class TestSaxpy(TestCase, BaseAxpy):
         blas_func = fblas.saxpy
         dtype = float32
 except AttributeError:
     class TestSaxpy: pass
-class TestDaxpy(BaseAxpy):
+class TestDaxpy(TestCase, BaseAxpy):
     blas_func = fblas.daxpy
     dtype = float64
 try:
-    class TestCaxpy(BaseAxpy):
+    class TestCaxpy(TestCase, BaseAxpy):
         blas_func = fblas.caxpy
         dtype = complex64
 except AttributeError:
     class TestCaxpy: pass
-class TestZaxpy(BaseAxpy):
+class TestZaxpy(TestCase, BaseAxpy):
     blas_func = fblas.zaxpy
     dtype = complex128
 
@@ -114,19 +114,20 @@
 ##################################################
 ### Test blas ?scal
 
-class BaseScal(NumpyTestCase):
-    def check_simple(self):
+class BaseScal(object):
+    # Mixin class for testing particular dtypes
+    def test_simple(self):
         x = arange(3.,dtype=self.dtype)
         real_x = x*3.
         self.blas_func(3.,x)
         assert_array_almost_equal(real_x,x)
-    def check_x_stride(self):
+    def test_x_stride(self):
         x = arange(6.,dtype=self.dtype)
         real_x = x.copy()
         real_x[::2] = x[::2]*array(3.,self.dtype)
         self.blas_func(3.,x,n=3,incx=2)
         assert_array_almost_equal(real_x,x)
-    def check_x_bad_size(self):
+    def test_x_bad_size(self):
         x = arange(12.,dtype=self.dtype)
         try:
             self.blas_func(2.,x,n=4,incx=5)
@@ -135,21 +136,21 @@
         # should catch error and never get here
         assert(0)
 try:
-    class TestSscal(BaseScal):
+    class TestSscal(TestCase, BaseScal):
         blas_func = fblas.sscal
         dtype = float32
 except AttributeError:
     class TestSscal: pass
-class TestDscal(BaseScal):
+class TestDscal(TestCase, BaseScal):
     blas_func = fblas.dscal
     dtype = float64
 try:
-    class TestCscal(BaseScal):
+    class TestCscal(TestCase, BaseScal):
         blas_func = fblas.cscal
         dtype = complex64
 except AttributeError:
     class TestCscal: pass
-class TestZscal(BaseScal):
+class TestZscal(TestCase, BaseScal):
     blas_func = fblas.zscal
     dtype = complex128
 
@@ -159,28 +160,29 @@
 ##################################################
 ### Test blas ?copy
 
-class BaseCopy(NumpyTestCase):
-    def check_simple(self):
+class BaseCopy(object):
+    # Mixin class for testing dtypes
+    def test_simple(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(shape(x),x.dtype)
         self.blas_func(x,y)
         assert_array_almost_equal(x,y)
-    def check_x_stride(self):
+    def test_x_stride(self):
         x = arange(6.,dtype=self.dtype)
         y = zeros(3,x.dtype)
         self.blas_func(x,y,n=3,incx=2)
         assert_array_almost_equal(x[::2],y)
-    def check_y_stride(self):
+    def test_y_stride(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         self.blas_func(x,y,n=3,incy=2)
         assert_array_almost_equal(x,y[::2])
-    def check_x_and_y_stride(self):
+    def test_x_and_y_stride(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         self.blas_func(x,y,n=3,incx=4,incy=2)
         assert_array_almost_equal(x[::4],y[::2])
-    def check_x_bad_size(self):
+    def test_x_bad_size(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         try:
@@ -189,7 +191,7 @@
             return
         # should catch error and never get here
         assert(0)
-    def check_y_bad_size(self):
+    def test_y_bad_size(self):
         x = arange(12.,dtype=complex64)
         y = zeros(6,x.dtype)
         try:
@@ -198,7 +200,7 @@
             return
         # should catch error and never get here
         assert(0)
-    #def check_y_bad_type(self):
+    #def test_y_bad_type(self):
     ##   Hmmm. Should this work?  What should be the output.
     #    x = arange(3.,dtype=self.dtype)
     #    y = zeros(shape(x))
@@ -206,21 +208,21 @@
     #    assert_array_almost_equal(x,y)
 
 try:
-    class TestScopy(BaseCopy):
+    class TestScopy(TestCase, BaseCopy):
         blas_func = fblas.scopy
         dtype = float32
 except AttributeError:
     class TestScopy: pass
-class TestDcopy(BaseCopy):
+class TestDcopy(TestCase, BaseCopy):
     blas_func = fblas.dcopy
     dtype = float64
 try:
-    class TestCcopy(BaseCopy):
+    class TestCcopy(TestCase, BaseCopy):
         blas_func = fblas.ccopy
         dtype = complex64
 except AttributeError:
     class TestCcopy: pass
-class TestZcopy(BaseCopy):
+class TestZcopy(TestCase, BaseCopy):
     blas_func = fblas.zcopy
     dtype = complex128
 
@@ -228,8 +230,9 @@
 ##################################################
 ### Test blas ?swap
 
-class BaseSwap(NumpyTestCase):
-    def check_simple(self):
+class BaseSwap(object):
+    # Mixin class to implement test objects
+    def test_simple(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(shape(x),x.dtype)
         desired_x = y.copy()
@@ -237,7 +240,7 @@
         self.blas_func(x,y)
         assert_array_almost_equal(desired_x,x)
         assert_array_almost_equal(desired_y,y)
-    def check_x_stride(self):
+    def test_x_stride(self):
         x = arange(6.,dtype=self.dtype)
         y = zeros(3,x.dtype)
         desired_x = y.copy()
@@ -245,7 +248,7 @@
         self.blas_func(x,y,n=3,incx=2)
         assert_array_almost_equal(desired_x,x[::2])
         assert_array_almost_equal(desired_y,y)
-    def check_y_stride(self):
+    def test_y_stride(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         desired_x = y.copy()[::2]
@@ -254,7 +257,7 @@
         assert_array_almost_equal(desired_x,x)
         assert_array_almost_equal(desired_y,y[::2])
 
-    def check_x_and_y_stride(self):
+    def test_x_and_y_stride(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         desired_x = y.copy()[::2]
@@ -262,7 +265,7 @@
         self.blas_func(x,y,n=3,incx=4,incy=2)
         assert_array_almost_equal(desired_x,x[::4])
         assert_array_almost_equal(desired_y,y[::2])
-    def check_x_bad_size(self):
+    def test_x_bad_size(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         try:
@@ -271,7 +274,7 @@
             return
         # should catch error and never get here
         assert(0)
-    def check_y_bad_size(self):
+    def test_y_bad_size(self):
         x = arange(12.,dtype=complex64)
         y = zeros(6,x.dtype)
         try:
@@ -282,21 +285,21 @@
         assert(0)
 
 try:
-    class TestSswap(BaseSwap):
+    class TestSswap(TestCase, BaseSwap):
         blas_func = fblas.sswap
         dtype = float32
 except AttributeError:
     class TestSswap: pass
-class TestDswap(BaseSwap):
+class TestDswap(TestCase, BaseSwap):
     blas_func = fblas.dswap
     dtype = float64
 try:
-    class TestCswap(BaseSwap):
+    class TestCswap(TestCase, BaseSwap):
         blas_func = fblas.cswap
         dtype = complex64
 except AttributeError:
     class TestCswap: pass
-class TestZswap(BaseSwap):
+class TestZswap(TestCase, BaseSwap):
     blas_func = fblas.zswap
     dtype = complex128
 
@@ -304,7 +307,8 @@
 ### Test blas ?gemv
 ### This will be a mess to test all cases.
 
-class BaseGemv(NumpyTestCase):
+class BaseGemv(object):
+    # Mixin class to test dtypes
     def get_data(self,x_stride=1,y_stride=1):
         mult = array(1, dtype = self.dtype)
         if self.dtype in [complex64, complex128]:
@@ -316,37 +320,37 @@
         x = arange(shape(a)[0]*x_stride,dtype=self.dtype) * mult
         y = arange(shape(a)[1]*y_stride,dtype=self.dtype) * mult
         return alpha,beta,a,x,y
-    def check_simple(self):
+    def test_simple(self):
         alpha,beta,a,x,y = self.get_data()
         desired_y = alpha*matrixmultiply(a,x)+beta*y
         y = self.blas_func(alpha,a,x,beta,y)
         assert_array_almost_equal(desired_y,y)
-    def check_default_beta_y(self):
+    def test_default_beta_y(self):
         alpha,beta,a,x,y = self.get_data()
         desired_y = matrixmultiply(a,x)
         y = self.blas_func(1,a,x)
         assert_array_almost_equal(desired_y,y)
-    def check_simple_transpose(self):
+    def test_simple_transpose(self):
         alpha,beta,a,x,y = self.get_data()
         desired_y = alpha*matrixmultiply(transpose(a),x)+beta*y
         y = self.blas_func(alpha,a,x,beta,y,trans=1)
         assert_array_almost_equal(desired_y,y)
-    def check_simple_transpose_conj(self):
+    def test_simple_transpose_conj(self):
         alpha,beta,a,x,y = self.get_data()
         desired_y = alpha*matrixmultiply(transpose(conjugate(a)),x)+beta*y
         y = self.blas_func(alpha,a,x,beta,y,trans=2)
         assert_array_almost_equal(desired_y,y)
-    def check_x_stride(self):
+    def test_x_stride(self):
         alpha,beta,a,x,y = self.get_data(x_stride=2)
         desired_y = alpha*matrixmultiply(a,x[::2])+beta*y
         y = self.blas_func(alpha,a,x,beta,y,incx=2)
         assert_array_almost_equal(desired_y,y)
-    def check_x_stride_transpose(self):
+    def test_x_stride_transpose(self):
         alpha,beta,a,x,y = self.get_data(x_stride=2)
         desired_y = alpha*matrixmultiply(transpose(a),x[::2])+beta*y
         y = self.blas_func(alpha,a,x,beta,y,trans=1,incx=2)
         assert_array_almost_equal(desired_y,y)
-    def check_x_stride_assert(self):
+    def test_x_stride_assert(self):
         # What is the use of this test?
         alpha,beta,a,x,y = self.get_data(x_stride=2)
         try:
@@ -359,19 +363,19 @@
             assert(0)
         except:
             pass
-    def check_y_stride(self):
+    def test_y_stride(self):
         alpha,beta,a,x,y = self.get_data(y_stride=2)
         desired_y = y.copy()
         desired_y[::2] = alpha*matrixmultiply(a,x)+beta*y[::2]
         y = self.blas_func(alpha,a,x,beta,y,incy=2)
         assert_array_almost_equal(desired_y,y)
-    def check_y_stride_transpose(self):
+    def test_y_stride_transpose(self):
         alpha,beta,a,x,y = self.get_data(y_stride=2)
         desired_y = y.copy()
         desired_y[::2] = alpha*matrixmultiply(transpose(a),x)+beta*y[::2]
         y = self.blas_func(alpha,a,x,beta,y,trans=1,incy=2)
         assert_array_almost_equal(desired_y,y)
-    def check_y_stride_assert(self):
+    def test_y_stride_assert(self):
         # What is the use of this test?
         alpha,beta,a,x,y = self.get_data(y_stride=2)
         try:
@@ -386,21 +390,21 @@
             pass
 
 try:
-    class TestSgemv(BaseGemv):
+    class TestSgemv(TestCase, BaseGemv):
         blas_func = fblas.sgemv
         dtype = float32
 except AttributeError:
     class TestSgemv: pass
-class TestDgemv(BaseGemv):
+class TestDgemv(TestCase, BaseGemv):
     blas_func = fblas.dgemv
     dtype = float64
 try:
-    class TestCgemv(BaseGemv):
+    class TestCgemv(TestCase, BaseGemv):
         blas_func = fblas.cgemv
         dtype = complex64
 except AttributeError:
     class TestCgemv: pass
-class TestZgemv(BaseGemv):
+class TestZgemv(TestCase, BaseGemv):
     blas_func = fblas.zgemv
     dtype = complex128
 
@@ -409,7 +413,7 @@
 ### Test blas ?ger
 ### This will be a mess to test all cases.
 
-class BaseGer(NumpyTestCase):
+class BaseGer(TestCase):
     def get_data(self,x_stride=1,y_stride=1):
         from numpy.random import normal
         alpha = array(1., dtype = self.dtype)
@@ -417,31 +421,31 @@
         x = arange(shape(a)[0]*x_stride,dtype=self.dtype)
         y = arange(shape(a)[1]*y_stride,dtype=self.dtype)
         return alpha,a,x,y
-    def check_simple(self):
+    def test_simple(self):
         alpha,a,x,y = self.get_data()
         # tranpose takes care of Fortran vs. C(and Python) memory layout
         desired_a = alpha*transpose(x[:,newaxis]*y) + a
         self.blas_func(x,y,a)
         assert_array_almost_equal(desired_a,a)
-    def check_x_stride(self):
+    def test_x_stride(self):
         alpha,a,x,y = self.get_data(x_stride=2)
         desired_a = alpha*transpose(x[::2,newaxis]*y) + a
         self.blas_func(x,y,a,incx=2)
         assert_array_almost_equal(desired_a,a)
-    def check_x_stride_assert(self):
+    def test_x_stride_assert(self):
         alpha,a,x,y = self.get_data(x_stride=2)
         try:
             self.blas_func(x,y,a,incx=3)
             assert(0)
         except:
             pass
-    def check_y_stride(self):
+    def test_y_stride(self):
         alpha,a,x,y = self.get_data(y_stride=2)
         desired_a = alpha*transpose(x[:,newaxis]*y[::2]) + a
         self.blas_func(x,y,a,incy=2)
         assert_array_almost_equal(desired_a,a)
 
-    def check_y_stride_assert(self):
+    def test_y_stride_assert(self):
         alpha,a,x,y = self.get_data(y_stride=2)
         try:
             self.blas_func(a,x,y,incy=3)
@@ -472,7 +476,7 @@
         y = normal(0.,1.,shape(a)[1]*y_stride).astype(self.dtype)
         y = y + y * array(1j, dtype = self.dtype)
         return alpha,a,x,y
-    def check_simple(self):
+    def test_simple(self):
         alpha,a,x,y = self.get_data()
         # tranpose takes care of Fortran vs. C(and Python) memory layout
         a = a * array(0.,dtype = self.dtype)
@@ -482,12 +486,12 @@
         fblas.cgeru(x,y,a,alpha = alpha)
         assert_array_almost_equal(desired_a,a)
 
-    #def check_x_stride(self):
+    #def test_x_stride(self):
     #    alpha,a,x,y = self.get_data(x_stride=2)
     #    desired_a = alpha*transpose(x[::2,newaxis]*self.transform(y)) + a
     #    self.blas_func(x,y,a,incx=2)
     #    assert_array_almost_equal(desired_a,a)
-    #def check_y_stride(self):
+    #def test_y_stride(self):
     #    alpha,a,x,y = self.get_data(y_stride=2)
     #    desired_a = alpha*transpose(x[:,newaxis]*self.transform(y[::2])) + a
     #    self.blas_func(x,y,a,incy=2)
@@ -518,4 +522,4 @@
 """
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/lib/lapack/__init__.py
===================================================================
--- trunk/scipy/lib/lapack/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/lib/lapack/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -90,5 +90,5 @@
 func_code = %(func_name)s.func_code
 '''
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/lib/lapack/tests/esv_tests.py
===================================================================
--- trunk/scipy/lib/lapack/tests/esv_tests.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/lib/lapack/tests/esv_tests.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,10 +1,10 @@
 
-from numpy.testing import *
-from numpy import *
+from scipy.testing import *
+from numpy import dot
 
-class _test_ev:
+class _test_ev(object):
 
-    def check_syev(self,level=1,sym='sy',suffix=''):
+    def check_syev(self,sym='sy',suffix=''):
         a = [[1,2,3],[2,2,3],[3,3,6]]
         exact_w = [-0.6699243371851365,0.4876938861533345,9.182230451031804]
         f = getattr(self.lapack,sym+'ev'+suffix)
@@ -20,7 +20,7 @@
 
     #def check_heevd(self): self.check_syev(sym='he',suffix='d')
 
-##    def check_heev_complex(self,level=1,suffix=''):
+##    def check_heev_complex(self,suffix=''):
 ##        a= [[1,2-2j,3+7j],[2+2j,2,3],[3-7j,3,5]]
 ##        exact_w=[-6.305141710654834,2.797880950890922,11.50726075976392]
 ##        f = getattr(self.lapack,'heev'+suffix)
@@ -32,7 +32,7 @@
 
     #def check_heevd_complex(self): self.check_heev_complex(suffix='d')
 
-    def check_syevr(self,level=1,sym='sy'):
+    def check_syevr(self,sym='sy'):
         a = [[1,2,3],[2,2,3],[3,3,6]]
         exact_w = [-0.6699243371851365,0.4876938861533345,9.182230451031804]
         f = getattr(self.lapack,sym+'evr')
@@ -42,7 +42,7 @@
         for i in range(3):
             assert_array_almost_equal(dot(a,v[:,i]),w[i]*v[:,i])
 
-##    def check_heevr_complex(self,level=1):
+##    def check_heevr_complex(self):
 ##        a= [[1,2-2j,3+7j],[2+2j,2,3],[3-7j,3,5]]
 ##        exact_w=[-6.305141710654834,2.797880950890922,11.50726075976392]
 ##        f = self.lapack.heevr
@@ -54,7 +54,7 @@
 
 ##    def check_heevr(self): self.check_syevr(sym='he')
 
-    def check_syevr_irange(self,level=1,sym='sy',irange=[0,2]):
+    def check_syevr_irange(self,sym='sy',irange=[0,2]):
         a = [[1,2,3],[2,2,3],[3,3,6]]
         exact_w = [-0.6699243371851365,0.4876938861533345,9.182230451031804]
         f = getattr(self.lapack,sym+'evr')
@@ -79,7 +79,7 @@
 
 ##    def check_heevr_irange_high(self): self.check_syevr_irange(sym='he',irange=[1,2])
 
-    def check_syevr_vrange(self,level=1,sym='sy',vrange=None):
+    def check_syevr_vrange(self,sym='sy',vrange=None):
         a = [[1,2,3],[2,2,3],[3,3,6]]
         exact_w = [-0.6699243371851365,0.4876938861533345,9.182230451031804]
         if vrange is None:

Modified: trunk/scipy/lib/lapack/tests/gesv_tests.py
===================================================================
--- trunk/scipy/lib/lapack/tests/gesv_tests.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/lib/lapack/tests/gesv_tests.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,10 +1,10 @@
 
-from numpy.testing import *
-from numpy import *
+from scipy.testing import *
+from numpy import dot
 
-class _test_gev:
+class _test_gev(object):
 
-    def check_sygv(self,level=1,sym='sy',suffix='',itype=1):
+    def check_sygv(self,sym='sy',suffix='',itype=1):
         a = [[1,2,3],[2,2,3],[3,3,6]]
         b = [[10,-1,1],[-1,8,-2],[1,-2,6]]
         f = getattr(self.lapack,sym+'gv'+suffix)

Modified: trunk/scipy/lib/lapack/tests/test_lapack.py
===================================================================
--- trunk/scipy/lib/lapack/tests/test_lapack.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/lib/lapack/tests/test_lapack.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -2,33 +2,33 @@
 #
 # Created by: Pearu Peterson, September 2002
 #
+'''
+This file adapted for nose tests 1/1/08
 
-__usage__ = """
-Build lapack:
-  python setup_lapack.py build
-Run tests if scipy is installed:
-  python -c 'import scipy;scipy.lib.lapack.test(<level>)'
-Run tests if lapack is not installed:
-  python tests/test_lapack.py [<level>]
-"""
+Note that the conversion is not very complete.
 
+This and the included files deliberately use "check_" as the test
+method names.  There are no subclasses of TestCase.  Thus nose will
+pick up nothing but the final test_all_lapack generator function.
+This does the work of collecting the test methods and checking if they
+can be run (see the isrunnable method).  
+'''
+
+import os
 import sys
-from numpy.testing import *
-from numpy import *
+from scipy.testing import *
+from numpy import dot, ones, zeros
 
-set_package_path()
-from lapack import flapack,clapack
-restore_path()
+from scipy.lib.lapack import flapack, clapack
 
-set_local_path()
+sys.path.insert(0, os.path.split(__file__))
 from gesv_tests import _test_gev
 from esv_tests import _test_ev
-restore_path()
+del sys.path[0]
 
 #class _test_ev: pass
 
-class _TestLapack(NumpyTestCase,
-                   _test_ev,
+class _TestLapack( _test_ev,
                    _test_gev):
 
     def check_gebal(self):
@@ -57,12 +57,13 @@
         assert not info,`info`
 
     def isrunnable(self,mthname):
+        ''' Return True if required routines for check method present in module '''
         l = mthname.split('_')
         if len(l)>1 and l[0]=='check':
             return hasattr(self.lapack,l[1])
         return 2
 
-class PrefixWrapper:
+class PrefixWrapper(object):
     def __init__(self,module,prefix):
         self.module = module
         self.prefix = prefix
@@ -122,5 +123,18 @@
         lapack = PrefixWrapper(clapack,'z')
         decimal = 12
 
-if __name__ == "__main__":
-    NumpyTest().run()
+# Collect test classes and methods with generator
+# This is a moderate hack replicating some obscure numpy testing
+# functionality for use with nose
+
+def test_all_lapack():
+    methods = []
+    for name, value in globals().items():
+        if not (name.startswith('Test')
+                and issubclass(value, _TestLapack)):
+            continue
+        o = value()
+        methods += [getattr(o, n) for n in dir(o) if o.isrunnable(n) is True]
+    for method in methods:
+        yield (method, )
+        

Modified: trunk/scipy/linalg/__init__.py
===================================================================
--- trunk/scipy/linalg/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -28,5 +28,5 @@
 
 del k, register_func
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/linalg/tests/test_atlas_version.py
===================================================================
--- trunk/scipy/linalg/tests/test_atlas_version.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/tests/test_atlas_version.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,10 +4,10 @@
 #
 
 import sys
-from numpy.testing import *
-set_package_path()
-import linalg.atlas_version
-restore_path()
+from scipy.testing import *
 
+import scipy.linalg.atlas_version
+
+
 # No futher tests possible.
 # Importing atlas_version will print out atlas version.

Modified: trunk/scipy/linalg/tests/test_basic.py
===================================================================
--- trunk/scipy/linalg/tests/test_basic.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/tests/test_basic.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -14,21 +14,21 @@
 Build linalg:
   python setup_linalg.py build
 Run tests if scipy is installed:
-  python -c 'import scipy;scipy.linalg.test(<level>)'
+  python -c 'import scipy;scipy.linalg.test()'
 Run tests if linalg is not installed:
-  python tests/test_basic.py [<level>]
+  python tests/test_basic.py
 """
 
 import numpy
 from numpy import arange, add, array, dot, zeros, identity, conjugate, transpose
 
 import sys
-from numpy.testing import *
-set_package_path()
-from linalg import solve,inv,det,lstsq, toeplitz, hankel, tri, triu, tril
-from linalg import pinv, pinv2, solve_banded
-restore_path()
+from scipy.testing import *
 
+from scipy.linalg import solve,inv,det,lstsq, toeplitz, hankel, tri, triu, \
+     tril, pinv, pinv2, solve_banded
+
+
 def random(size):
     return rand(*size)
 
@@ -37,9 +37,9 @@
     data = add.outer(data,data)
     return data
 
-class TestSolveBanded(NumpyTestCase):
+class TestSolveBanded(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
 
         a = [[1,20,0,0],[-30,4,6,0],[2,1,20,2],[0,-1,7,14]]
         ab = [[0,20,6,2],
@@ -52,9 +52,9 @@
             x = solve_banded((l,u),ab,b)
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-class TestSolve(NumpyTestCase):
+class TestSolve(TestCase):
 
-    def check_20Feb04_bug(self):
+    def test_20Feb04_bug(self):
         a = [[1,1],[1.0,0]] # ok
         x0 = solve(a,[1,0j])
         assert_array_almost_equal(numpy.dot(a,x0),[1,0])
@@ -64,21 +64,21 @@
         x0 = solve(a,b)
         assert_array_almost_equal(numpy.dot(a,x0),[1,0])
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[1,20],[-30,4]]
         for b in ([[1,0],[0,1]],[1,0],
                   [[2,1],[-30,4]]):
             x = solve(a,b)
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_simple_sym(self):
+    def test_simple_sym(self):
         a = [[2,3],[3,5]]
         for lower in [0,1]:
             for b in ([[1,0],[0,1]],[1,0]):
                 x = solve(a,b,sym_pos=1,lower=lower)
                 assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_simple_sym_complex(self):
+    def test_simple_sym_complex(self):
         a = [[5,2],[2,4]]
         for b in [[1j,0],
                   [[1j,1j],
@@ -87,7 +87,7 @@
             x = solve(a,b,sym_pos=1)
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = array([[5,2],[2j,4]],'D')
         for b in [[1j,0],
                   [[1j,1j],
@@ -98,7 +98,7 @@
             x = solve(a,b)
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_nils_20Feb04(self):
+    def test_nils_20Feb04(self):
         n = 2
         A = random([n,n])+random([n,n])*1j
         X = zeros((n,n),'D')
@@ -109,7 +109,7 @@
             X[:,i] = solve(A,r)
         assert_array_almost_equal(X,Ainv)
 
-    def check_random(self):
+    def test_random(self):
 
         n = 20
         a = random([n,n])
@@ -119,7 +119,7 @@
             x = solve(a,b)
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         n = 20
         a = random([n,n]) + 1j * random([n,n])
         for i in range(n): a[i,i] = 20*(.1+a[i,i])
@@ -128,7 +128,7 @@
             x = solve(a,b)
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_random_sym(self):
+    def test_random_sym(self):
         n = 20
         a = random([n,n])
         for i in range(n):
@@ -140,7 +140,7 @@
             x = solve(a,b,sym_pos=1)
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_random_sym_complex(self):
+    def test_random_sym_complex(self):
         n = 20
         a = random([n,n])
         #a  = a + 1j*random([n,n]) # XXX: with this the accuracy will be very low
@@ -153,7 +153,8 @@
             x = solve(a,b,sym_pos=1)
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_bench_random(self):
         import numpy.linalg as linalg
         basic_solve = linalg.solve
         print
@@ -174,26 +175,26 @@
             for i in range(size): a[i,i] = 10*(.1+a[i,i])
             b = random([size])
 
-            print '| %6.2f ' % self.measure('solve(a,b)',repeat),
+            print '| %6.2f ' % measure('solve(a,b)',repeat),
             sys.stdout.flush()
 
-            print '| %6.2f ' % self.measure('basic_solve(a,b)',repeat),
+            print '| %6.2f ' % measure('basic_solve(a,b)',repeat),
             sys.stdout.flush()
 
             a = a[-1::-1,-1::-1] # turn into a non-contiguous array
             assert not a.flags['CONTIGUOUS']
 
-            print '| %6.2f ' % self.measure('solve(a,b)',repeat),
+            print '| %6.2f ' % measure('solve(a,b)',repeat),
             sys.stdout.flush()
 
-            print '| %6.2f ' % self.measure('basic_solve(a,b)',repeat),
+            print '| %6.2f ' % measure('basic_solve(a,b)',repeat),
             sys.stdout.flush()
 
             print '   (secs for %s calls)' % (repeat)
 
-class TestInv(NumpyTestCase):
+class TestInv(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[1,2],[3,4]]
         a_inv = inv(a)
         assert_array_almost_equal(numpy.dot(a,a_inv),
@@ -203,7 +204,7 @@
         assert_array_almost_equal(numpy.dot(a,a_inv),
                                   [[1,0,0],[0,1,0],[0,0,1]])
 
-    def check_random(self):
+    def test_random(self):
         n = 20
         for i in range(4):
             a = random([n,n])
@@ -211,13 +212,13 @@
             a_inv = inv(a)
             assert_array_almost_equal(numpy.dot(a,a_inv),
                                       numpy.identity(n))
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = [[1,2],[3,4j]]
         a_inv = inv(a)
         assert_array_almost_equal(numpy.dot(a,a_inv),
                                   [[1,0],[0,1]])
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         n = 20
         for i in range(4):
             a = random([n,n])+2j*random([n,n])
@@ -226,7 +227,8 @@
             assert_array_almost_equal(numpy.dot(a,a_inv),
                                       numpy.identity(n))
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_bench_random(self):
         import numpy.linalg as linalg
         basic_inv = linalg.inv
         print
@@ -245,37 +247,37 @@
             # large diagonal ensures non-singularity:
             for i in range(size): a[i,i] = 10*(.1+a[i,i])
 
-            print '| %6.2f ' % self.measure('inv(a)',repeat),
+            print '| %6.2f ' % measure('inv(a)',repeat),
             sys.stdout.flush()
 
-            print '| %6.2f ' % self.measure('basic_inv(a)',repeat),
+            print '| %6.2f ' % measure('basic_inv(a)',repeat),
             sys.stdout.flush()
 
             a = a[-1::-1,-1::-1] # turn into a non-contiguous array
             assert not a.flags['CONTIGUOUS']
 
-            print '| %6.2f ' % self.measure('inv(a)',repeat),
+            print '| %6.2f ' % measure('inv(a)',repeat),
             sys.stdout.flush()
 
-            print '| %6.2f ' % self.measure('basic_inv(a)',repeat),
+            print '| %6.2f ' % measure('basic_inv(a)',repeat),
             sys.stdout.flush()
 
             print '   (secs for %s calls)' % (repeat)
 
 
-class TestDet(NumpyTestCase):
+class TestDet(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[1,2],[3,4]]
         a_det = det(a)
         assert_almost_equal(a_det,-2.0)
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = [[1,2],[3,4j]]
         a_det = det(a)
         assert_almost_equal(a_det,-6+4j)
 
-    def check_random(self):
+    def test_random(self):
         import numpy.linalg as linalg
         basic_det = linalg.det
         n = 20
@@ -285,7 +287,7 @@
             d2 = basic_det(a)
             assert_almost_equal(d1,d2)
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         import numpy.linalg as linalg
         basic_det = linalg.det
         n = 20
@@ -295,7 +297,8 @@
             d2 = basic_det(a)
             assert_almost_equal(d1,d2)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_bench_random(self):
         import numpy.linalg as linalg
         basic_det = linalg.det
         print
@@ -312,19 +315,19 @@
 
             a = random([size,size])
 
-            print '| %6.2f ' % self.measure('det(a)',repeat),
+            print '| %6.2f ' % measure('det(a)',repeat),
             sys.stdout.flush()
 
-            print '| %6.2f ' % self.measure('basic_det(a)',repeat),
+            print '| %6.2f ' % measure('basic_det(a)',repeat),
             sys.stdout.flush()
 
             a = a[-1::-1,-1::-1] # turn into a non-contiguous array
             assert not a.flags['CONTIGUOUS']
 
-            print '| %6.2f ' % self.measure('det(a)',repeat),
+            print '| %6.2f ' % measure('det(a)',repeat),
             sys.stdout.flush()
 
-            print '| %6.2f ' % self.measure('basic_det(a)',repeat),
+            print '| %6.2f ' % measure('basic_det(a)',repeat),
             sys.stdout.flush()
 
             print '   (secs for %s calls)' % (repeat)
@@ -338,8 +341,8 @@
     b1 = dot(at, b)
     return solve(a1, b1)
 
-class TestLstsq(NumpyTestCase):
-    def check_random_overdet_large(self):
+class TestLstsq(TestCase):
+    def test_random_overdet_large(self):
         #bug report: Nils Wagner
         n = 200
         a = random([n,2])
@@ -348,21 +351,21 @@
         x = lstsq(a,b)[0]
         assert_array_almost_equal(x,direct_lstsq(a,b))
 
-    def check_simple_exact(self):
+    def test_simple_exact(self):
         a = [[1,20],[-30,4]]
         for b in ([[1,0],[0,1]],[1,0],
                   [[2,1],[-30,4]]):
             x = lstsq(a,b)[0]
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_simple_overdet(self):
+    def test_simple_overdet(self):
         a = [[1,2],[4,5],[3,4]]
         b = [1,2,3]
         x,res,r,s = lstsq(a,b)
         #XXX: check defintion of res
         assert_array_almost_equal(x,direct_lstsq(a,b))
 
-    def check_simple_underdet(self):
+    def test_simple_underdet(self):
         a = [[1,2,3],[4,5,6]]
         b = [1,2]
         x,res,r,s = lstsq(a,b)
@@ -370,7 +373,7 @@
         assert_array_almost_equal(x,[[-0.05555556],
                                      [0.11111111],[0.27777778]])
 
-    def check_random_exact(self):
+    def test_random_exact(self):
 
         n = 20
         a = random([n,n])
@@ -380,7 +383,7 @@
             x = lstsq(a,b)[0]
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_random_complex_exact(self):
+    def test_random_complex_exact(self):
         n = 20
         a = random([n,n]) + 1j * random([n,n])
         for i in range(n): a[i,i] = 20*(.1+a[i,i])
@@ -389,7 +392,7 @@
             x = lstsq(a,b)[0]
             assert_array_almost_equal(numpy.dot(a,x),b)
 
-    def check_random_overdet(self):
+    def test_random_overdet(self):
         n = 20
         m = 15
         a = random([n,m])
@@ -401,7 +404,7 @@
             #XXX: check definition of res
             assert_array_almost_equal(x,direct_lstsq(a,b))
 
-    def check_random_complex_overdet(self):
+    def test_random_complex_overdet(self):
         n = 20
         m = 15
         a = random([n,m]) + 1j * random([n,m])
@@ -414,8 +417,8 @@
             #XXX: check definition of res
             assert_array_almost_equal(x,direct_lstsq(a,b,1))
 
-class TestTri(NumpyTestCase):
-    def check_basic(self):
+class TestTri(TestCase):
+    def test_basic(self):
         assert_equal(tri(4),array([[1,0,0,0],
                                    [1,1,0,0],
                                    [1,1,1,0],
@@ -424,7 +427,7 @@
                                                 [1,1,0,0],
                                                 [1,1,1,0],
                                                 [1,1,1,1]],'f'))
-    def check_diag(self):
+    def test_diag(self):
         assert_equal(tri(4,k=1),array([[1,1,0,0],
                                        [1,1,1,0],
                                        [1,1,1,1],
@@ -433,7 +436,7 @@
                                         [1,0,0,0],
                                         [1,1,0,0],
                                         [1,1,1,0]]))
-    def check_2d(self):
+    def test_2d(self):
         assert_equal(tri(4,3),array([[1,0,0],
                                      [1,1,0],
                                      [1,1,1],
@@ -441,7 +444,7 @@
         assert_equal(tri(3,4),array([[1,0,0,0],
                                      [1,1,0,0],
                                      [1,1,1,0]]))
-    def check_diag2d(self):
+    def test_diag2d(self):
         assert_equal(tri(3,4,k=2),array([[1,1,1,0],
                                          [1,1,1,1],
                                          [1,1,1,1]]))
@@ -450,8 +453,8 @@
                                           [1,0,0],
                                           [1,1,0]]))
 
-class TestTril(NumpyTestCase):
-    def check_basic(self):
+class TestTril(TestCase):
+    def test_basic(self):
         a = (100*get_mat(5)).astype('l')
         b = a.copy()
         for k in range(5):
@@ -459,7 +462,7 @@
                 b[k,l] = 0
         assert_equal(tril(a),b)
 
-    def check_diag(self):
+    def test_diag(self):
         a = (100*get_mat(5)).astype('f')
         b = a.copy()
         for k in range(5):
@@ -472,8 +475,8 @@
                 b[k,l] = 0
         assert_equal(tril(a,k=-2),b)
 
-class TestTriu(NumpyTestCase):
-    def check_basic(self):
+class TestTriu(TestCase):
+    def test_basic(self):
         a = (100*get_mat(5)).astype('l')
         b = a.copy()
         for k in range(5):
@@ -481,7 +484,7 @@
                 b[l,k] = 0
         assert_equal(triu(a),b)
 
-    def check_diag(self):
+    def test_diag(self):
         a = (100*get_mat(5)).astype('f')
         b = a.copy()
         for k in range(5):
@@ -494,46 +497,46 @@
                 b[l,k] = 0
         assert_equal(triu(a,k=-2),b)
 
-class TestToeplitz(NumpyTestCase):
-    def check_basic(self):
+class TestToeplitz(TestCase):
+    def test_basic(self):
         y = toeplitz([1,2,3])
         assert_array_equal(y,[[1,2,3],[2,1,2],[3,2,1]])
         y = toeplitz([1,2,3],[1,4,5])
         assert_array_equal(y,[[1,4,5],[2,1,4],[3,2,1]])
 
-class TestHankel(NumpyTestCase):
-    def check_basic(self):
+class TestHankel(TestCase):
+    def test_basic(self):
         y = hankel([1,2,3])
         assert_array_equal(y,[[1,2,3],[2,3,0],[3,0,0]])
         y = hankel([1,2,3],[3,4,5])
         assert_array_equal(y,[[1,2,3],[2,3,4],[3,4,5]])
 
-class TestPinv(NumpyTestCase):
+class TestPinv(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a=array([[1,2,3],[4,5,6.],[7,8,10]])
         a_pinv = pinv(a)
         assert_array_almost_equal(dot(a,a_pinv),[[1,0,0],[0,1,0],[0,0,1]])
         a_pinv = pinv2(a)
         assert_array_almost_equal(dot(a,a_pinv),[[1,0,0],[0,1,0],[0,0,1]])
 
-    def check_simple_0det(self):
+    def test_simple_0det(self):
         a=array([[1,2,3],[4,5,6.],[7,8,9]])
         a_pinv = pinv(a)
         a_pinv2 = pinv2(a)
         assert_array_almost_equal(a_pinv,a_pinv2)
 
-    def check_simple_cols(self):
+    def test_simple_cols(self):
         a=array([[1,2,3],[4,5,6.]])
         a_pinv = pinv(a)
         a_pinv2 = pinv2(a)
         assert_array_almost_equal(a_pinv,a_pinv2)
 
-    def check_simple_rows(self):
+    def test_simple_rows(self):
         a=array([[1,2],[3,4],[5,6]])
         a_pinv = pinv(a)
         a_pinv2 = pinv2(a)
         assert_array_almost_equal(a_pinv,a_pinv2)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/linalg/tests/test_blas.py
===================================================================
--- trunk/scipy/linalg/tests/test_blas.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/tests/test_blas.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -12,21 +12,19 @@
   python tests/test_blas.py [<level>]
 """
 
+import sys
+import math
 
 from numpy import arange, add, array
-import math
 
-import sys
-from numpy.testing import *
-set_package_path()
-from linalg import fblas
-print fblas
-from linalg import cblas
-restore_path()
+from scipy.testing import *
 
-class TestCBLAS1Simple(NumpyTestCase):
+from scipy.linalg import fblas, cblas
 
-    def check_axpy(self):
+
+class TestCBLAS1Simple(TestCase):
+
+    def test_axpy(self):
         for p in 'sd':
             f = getattr(cblas,p+'axpy',None)
             if f is None: continue
@@ -36,9 +34,9 @@
             if f is None: continue
             assert_array_almost_equal(f(5,[1,2j,3],[2,-1,3]),[7,10j-1,18])
 
-class TestFBLAS1Simple(NumpyTestCase):
+class TestFBLAS1Simple(TestCase):
 
-    def check_axpy(self):
+    def test_axpy(self):
         for p in 'sd':
             f = getattr(fblas,p+'axpy',None)
             if f is None: continue
@@ -47,7 +45,7 @@
             f = getattr(fblas,p+'axpy',None)
             if f is None: continue
             assert_array_almost_equal(f([1,2j,3],[2,-1,3],a=5),[7,10j-1,18])
-    def check_copy(self):
+    def test_copy(self):
         for p in 'sd':
             f = getattr(fblas,p+'copy',None)
             if f is None: continue
@@ -56,7 +54,7 @@
             f = getattr(fblas,p+'copy',None)
             if f is None: continue
             assert_array_almost_equal(f([3,4j,5+3j],[8]*3),[3,4j,5+3j])
-    def check_asum(self):
+    def test_asum(self):
         for p in 'sd':
             f = getattr(fblas,p+'asum',None)
             if f is None: continue
@@ -65,24 +63,24 @@
             f = getattr(fblas,p+'asum',None)
             if f is None: continue
             assert_almost_equal(f([3j,-4,3-4j]),14)
-    def check_dot(self):
+    def test_dot(self):
         for p in 'sd':
             f = getattr(fblas,p+'dot',None)
             if f is None: continue
             assert_almost_equal(f([3,-4,5],[2,5,1]),-9)
-    def check_complex_dotu(self):
+    def test_complex_dotu(self):
         for p in 'cz':
             f = getattr(fblas,p+'dotu',None)
             if f is None: continue
             assert_almost_equal(f([3j,-4,3-4j],[2,3,1]),-9+2j)
 
-    def check_complex_dotc(self):
+    def test_complex_dotc(self):
         for p in 'cz':
             f = getattr(fblas,p+'dotc',None)
             if f is None: continue
             assert_almost_equal(f([3j,-4,3-4j],[2,3j,1]),3-14j)
 
-    def check_nrm2(self):
+    def test_nrm2(self):
         for p in 'sd':
             f = getattr(fblas,p+'nrm2',None)
             if f is None: continue
@@ -91,7 +89,7 @@
             f = getattr(fblas,p+'nrm2',None)
             if f is None: continue
             assert_almost_equal(f([3j,-4,3-4j]),math.sqrt(50))
-    def check_scal(self):
+    def test_scal(self):
         for p in 'sd':
             f = getattr(fblas,p+'scal',None)
             if f is None: continue
@@ -104,7 +102,7 @@
             f = getattr(fblas,p+'scal',None)
             if f is None: continue
             assert_array_almost_equal(f(3,[3j,-4,3-4j]),[9j,-12,9-12j])
-    def check_swap(self):
+    def test_swap(self):
         for p in 'sd':
             f = getattr(fblas,p+'swap',None)
             if f is None: continue
@@ -119,7 +117,7 @@
             x1,y1 = f(x,y)
             assert_array_almost_equal(x1,y)
             assert_array_almost_equal(y1,x)
-    def check_amax(self):
+    def test_amax(self):
         for p in 'sd':
             f = getattr(fblas,'i'+p+'amax')
             assert_equal(f([-2,4,3]),1)
@@ -128,9 +126,9 @@
             assert_equal(f([-5,4+3j,6]),1)
     #XXX: need tests for rot,rotm,rotg,rotmg
 
-class TestFBLAS2Simple(NumpyTestCase):
+class TestFBLAS2Simple(TestCase):
 
-    def check_gemv(self):
+    def test_gemv(self):
         for p in 'sd':
             f = getattr(fblas,p+'gemv',None)
             if f is None: continue
@@ -142,7 +140,7 @@
             assert_array_almost_equal(f(3j,[[3-4j]],[-4]),[-48-36j])
             assert_array_almost_equal(f(3j,[[3-4j]],[-4],3,[5j]),[-48-21j])
 
-    def check_ger(self):
+    def test_ger(self):
 
         for p in 'sd':
             f = getattr(fblas,p+'ger',None)
@@ -176,9 +174,9 @@
                                            2j,
                                            3j],[3j,4j]),[[6,8],[12,16],[18,24]])
 
-class TestFBLAS3Simple(NumpyTestCase):
+class TestFBLAS3Simple(TestCase):
 
-    def check_gemm(self):
+    def test_gemm(self):
         for p in 'sd':
             f = getattr(fblas,p+'gemm',None)
             if f is None: continue
@@ -190,9 +188,9 @@
             assert_array_almost_equal(f(3j,[3-4j],[-4]),[[-48-36j]])
             assert_array_almost_equal(f(3j,[3-4j],[-4],3,[5j]),[-48-21j])
 
-class TestBLAS(NumpyTestCase):
+class TestBLAS(TestCase):
 
-    def check_fblas(self):
+    def test_fblas(self):
         if hasattr(fblas,'empty_module'):
             print """
 ****************************************************************
@@ -201,7 +199,7 @@
 See scipy/INSTALL.txt for troubleshooting.
 ****************************************************************
 """
-    def check_cblas(self):
+    def test_cblas(self):
         if hasattr(cblas,'empty_module'):
             print """
 ****************************************************************
@@ -215,4 +213,4 @@
 """
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/linalg/tests/test_decomp.py
===================================================================
--- trunk/scipy/linalg/tests/test_decomp.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/tests/test_decomp.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -9,37 +9,41 @@
 Build linalg:
   python setup_linalg.py build
 Run tests if scipy is installed:
-  python -c 'import scipy;scipy.linalg.test(<level>)'
+  python -c 'import scipy;scipy.linalg.test()'
 Run tests if linalg is not installed:
-  python tests/test_decomp.py [<level>]
+  python tests/test_decomp.py 
 """
 
 import sys
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
-from linalg import eig,eigvals,lu,svd,svdvals,cholesky,qr,schur,rsf2csf
-from linalg import lu_solve,lu_factor,solve,diagsvd,hessenberg,rq
-from linalg import eig_banded,eigvals_banded
-from linalg.flapack import dgbtrf, dgbtrs, zgbtrf, zgbtrs
-from linalg.flapack import dsbev, dsbevd, dsbevx, zhbevd, zhbevx
-restore_path()
 
-from numpy import *
+from scipy.linalg import eig,eigvals,lu,svd,svdvals,cholesky,qr, \
+     schur,rsf2csf, lu_solve,lu_factor,solve,diagsvd,hessenberg,rq, \
+     eig_banded, eigvals_banded
+from scipy.linalg.flapack import dgbtrf, dgbtrs, zgbtrf, zgbtrs, \
+     dsbev, dsbevd, dsbevx, zhbevd, zhbevx
+
+from numpy import array, transpose, sometrue, diag, ones, linalg, \
+     argsort, zeros, arange, float32, complex64, dot, conj, identity, \
+     ravel, sqrt, iscomplex, shape, sort, sign, conjugate, sign, bmat, \
+     asarray, matrix, isfinite
+
+
 from numpy.random import rand
 
 def random(size):
     return rand(*size)
 
-class TestEigVals(NumpyTestCase):
+class TestEigVals(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[1,2,3],[1,2,3],[2,5,6]]
         w = eigvals(a)
         exact_w = [(9+sqrt(93))/2,0,(9-sqrt(93))/2]
         assert_array_almost_equal(w,exact_w)
 
-    def check_simple_tr(self):
+    def test_simple_tr(self):
         a = array([[1,2,3],[1,2,3],[2,5,6]],'d')
         a = transpose(a).copy()
         a = transpose(a)
@@ -47,7 +51,7 @@
         exact_w = [(9+sqrt(93))/2,0,(9-sqrt(93))/2]
         assert_array_almost_equal(w,exact_w)
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = [[1,2,3],[1,2,3],[2,5,6+1j]]
         w = eigvals(a)
         exact_w = [(9+1j+sqrt(92+6j))/2,
@@ -55,7 +59,8 @@
                    (9+1j-sqrt(92+6j))/2]
         assert_array_almost_equal(w,exact_w)
 
-    def bench_random(self,level=5):
+    @dec.bench
+    def test_bench_random(self):
         import numpy.linalg as linalg
         Numeric_eigvals = linalg.eigvals
         print
@@ -72,14 +77,14 @@
 
             a = random([size,size])
 
-            print '| %6.2f ' % self.measure('eigvals(a)',repeat),
+            print '| %6.2f ' % measure('eigvals(a)',repeat),
             sys.stdout.flush()
 
             print '   (secs for %s calls)' % (repeat)
 
-class TestEig(NumpyTestCase):
+class TestEig(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[1,2,3],[1,2,3],[2,5,6]]
         w,v = eig(a)
         exact_w = [(9+sqrt(93))/2,0,(9-sqrt(93))/2]
@@ -99,7 +104,7 @@
         for i in range(3):
             assert_array_almost_equal(dot(transpose(a),v[:,i]),w[i]*v[:,i])
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = [[1,2,3],[1,2,3],[2,5,6+1j]]
         w,vl,vr = eig(a,left=1,right=1)
         for i in range(3):
@@ -151,10 +156,10 @@
             if all(isfinite(res[:, i])):
                 assert_array_almost_equal(res[:, i], 0)
 
-class TestEigBanded(NumpyTestCase):
+class TestEigBanded(TestCase):
 
     def __init__(self, *args):
-        NumpyTestCase.__init__(self, *args)
+        TestCase.__init__(self, *args)
 
         self.create_bandmat()
 
@@ -238,7 +243,7 @@
     #####################################################################
 
 
-    def check_dsbev(self):
+    def test_dsbev(self):
         """Compare dsbev eigenvalues and eigenvectors with
            the result of linalg.eig."""
         w, evec, info  = dsbev(self.bandmat_sym, compute_v=1)
@@ -248,7 +253,7 @@
 
 
 
-    def check_dsbevd(self):
+    def test_dsbevd(self):
         """Compare dsbevd eigenvalues and eigenvectors with
            the result of linalg.eig."""
         w, evec, info = dsbevd(self.bandmat_sym, compute_v=1)
@@ -258,7 +263,7 @@
 
 
 
-    def check_dsbevx(self):
+    def test_dsbevx(self):
         """Compare dsbevx eigenvalues and eigenvectors
            with the result of linalg.eig."""
         N,N = shape(self.sym_mat)
@@ -270,7 +275,7 @@
         assert_array_almost_equal(abs(evec_), abs(self.evec_sym_lin))
 
 
-    def check_zhbevd(self):
+    def test_zhbevd(self):
         """Compare zhbevd eigenvalues and eigenvectors
            with the result of linalg.eig."""
         w, evec, info = zhbevd(self.bandmat_herm, compute_v=1)
@@ -280,7 +285,7 @@
 
 
 
-    def check_zhbevx(self):
+    def test_zhbevx(self):
         """Compare zhbevx eigenvalues and eigenvectors
            with the result of linalg.eig."""
         N,N = shape(self.herm_mat)
@@ -293,7 +298,7 @@
 
 
 
-    def check_eigvals_banded(self):
+    def test_eigvals_banded(self):
         """Compare eigenvalues of eigvals_banded with those of linalg.eig."""
         w_sym = eigvals_banded(self.bandmat_sym)
         w_sym = w_sym.real
@@ -332,7 +337,7 @@
 
 
 
-    def check_eig_banded(self):
+    def test_eig_banded(self):
         """Compare eigenvalues and eigenvectors of eig_banded
            with those of linalg.eig. """
         w_sym, evec_sym = eig_banded(self.bandmat_sym)
@@ -382,7 +387,7 @@
                                   abs(self.evec_herm_lin[:,ind1:ind2+1]) )
 
 
-    def check_dgbtrf(self):
+    def test_dgbtrf(self):
         """Compare dgbtrf  LU factorisation with the LU factorisation result
            of linalg.lu."""
         M,N = shape(self.real_mat)
@@ -397,7 +402,7 @@
         assert_array_almost_equal(u, u_lin)
 
 
-    def check_zgbtrf(self):
+    def test_zgbtrf(self):
         """Compare zgbtrf  LU factorisation with the LU factorisation result
            of linalg.lu."""
         M,N = shape(self.comp_mat)
@@ -413,7 +418,7 @@
 
 
 
-    def check_dgbtrs(self):
+    def test_dgbtrs(self):
         """Compare dgbtrs  solutions for linear equation system  A*x = b
            with solutions of linalg.solve."""
 
@@ -423,7 +428,7 @@
         y_lin = linalg.solve(self.real_mat, self.b)
         assert_array_almost_equal(y, y_lin)
 
-    def check_zgbtrs(self):
+    def test_zgbtrs(self):
         """Compare zgbtrs  solutions for linear equation system  A*x = b
            with solutions of linalg.solve."""
 
@@ -436,10 +441,10 @@
 
 
 
-class TestLU(NumpyTestCase):
+class TestLU(TestCase):
 
     def __init__(self, *args, **kw):
-        NumpyTestCase.__init__(self, *args, **kw)
+        TestCase.__init__(self, *args, **kw)
 
         self.a = array([[1,2,3],[1,2,3],[2,5,6]])
         self.ca = array([[1,2,3],[1,2,3],[2,5j,6]])
@@ -466,37 +471,37 @@
         assert_array_almost_equal(dot(pl,u),data)
 
     # Simple tests
-    def check_simple(self):
+    def test_simple(self):
         self._test_common(self.a)
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         self._test_common(self.ca)
 
-    def check_simple2(self):
+    def test_simple2(self):
         self._test_common(self.b)
 
-    def check_simple2_complex(self):
+    def test_simple2_complex(self):
         self._test_common(self.cb)
 
     # rectangular matrices tests
-    def check_hrectangular(self):
+    def test_hrectangular(self):
         self._test_common(self.hrect)
 
-    def check_vrectangular(self):
+    def test_vrectangular(self):
         self._test_common(self.vrect)
 
-    def check_hrectangular_complex(self):
+    def test_hrectangular_complex(self):
         self._test_common(self.chrect)
 
-    def check_vrectangular_complex(self):
+    def test_vrectangular_complex(self):
         self._test_common(self.cvrect)
 
     # Bigger matrices
-    def check_medium1(self, level = 2):
+    def test_medium1(self):
         """Check lu decomposition on medium size, rectangular matrix."""
         self._test_common(self.med)
 
-    def check_medium1_complex(self, level = 2):
+    def test_medium1_complex(self):
         """Check lu decomposition on medium size, rectangular matrix."""
         self._test_common(self.cmed)
 
@@ -519,8 +524,8 @@
         self.med = self.vrect.astype(float32)
         self.cmed = self.vrect.astype(complex64)
 
-class TestLUSolve(NumpyTestCase):
-    def check_lu(self):
+class TestLUSolve(TestCase):
+    def test_lu(self):
         a = random((10,10))
         b = random((10,))
 
@@ -531,9 +536,9 @@
 
         assert_array_equal(x1,x2)
 
-class TestSVD(NumpyTestCase):
+class TestSVD(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[1,2,3],[1,20,3],[2,5,6]]
         u,s,vh = svd(a)
         assert_array_almost_equal(dot(transpose(u),u),identity(3))
@@ -542,7 +547,7 @@
         for i in range(len(s)): sigma[i,i] = s[i]
         assert_array_almost_equal(dot(dot(u,sigma),vh),a)
 
-    def check_simple_singular(self):
+    def test_simple_singular(self):
         a = [[1,2,3],[1,2,3],[2,5,6]]
         u,s,vh = svd(a)
         assert_array_almost_equal(dot(transpose(u),u),identity(3))
@@ -551,7 +556,7 @@
         for i in range(len(s)): sigma[i,i] = s[i]
         assert_array_almost_equal(dot(dot(u,sigma),vh),a)
 
-    def check_simple_underdet(self):
+    def test_simple_underdet(self):
         a = [[1,2,3],[4,5,6]]
         u,s,vh = svd(a)
         assert_array_almost_equal(dot(transpose(u),u),identity(2))
@@ -560,7 +565,7 @@
         for i in range(len(s)): sigma[i,i] = s[i]
         assert_array_almost_equal(dot(dot(u,sigma),vh),a)
 
-    def check_simple_overdet(self):
+    def test_simple_overdet(self):
         a = [[1,2],[4,5],[3,4]]
         u,s,vh = svd(a)
         assert_array_almost_equal(dot(transpose(u),u),identity(3))
@@ -569,7 +574,7 @@
         for i in range(len(s)): sigma[i,i] = s[i]
         assert_array_almost_equal(dot(dot(u,sigma),vh),a)
 
-    def check_random(self):
+    def test_random(self):
         n = 20
         m = 15
         for i in range(3):
@@ -581,7 +586,7 @@
                 for i in range(len(s)): sigma[i,i] = s[i]
                 assert_array_almost_equal(dot(dot(u,sigma),vh),a)
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = [[1,2,3],[1,2j,3],[2,5,6]]
         u,s,vh = svd(a)
         assert_array_almost_equal(dot(conj(transpose(u)),u),identity(3))
@@ -590,7 +595,7 @@
         for i in range(len(s)): sigma[i,i] = s[i]
         assert_array_almost_equal(dot(dot(u,sigma),vh),a)
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         n = 20
         m = 15
         for i in range(3):
@@ -604,52 +609,52 @@
                 for i in range(len(s)): sigma[i,i] = s[i]
                 assert_array_almost_equal(dot(dot(u,sigma),vh),a)
 
-class TestSVDVals(NumpyTestCase):
+class TestSVDVals(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[1,2,3],[1,2,3],[2,5,6]]
         s = svdvals(a)
         assert len(s)==3
         assert s[0]>=s[1]>=s[2]
 
-    def check_simple_underdet(self):
+    def test_simple_underdet(self):
         a = [[1,2,3],[4,5,6]]
         s = svdvals(a)
         assert len(s)==2
         assert s[0]>=s[1]
 
-    def check_simple_overdet(self):
+    def test_simple_overdet(self):
         a = [[1,2],[4,5],[3,4]]
         s = svdvals(a)
         assert len(s)==2
         assert s[0]>=s[1]
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = [[1,2,3],[1,20,3j],[2,5,6]]
         s = svdvals(a)
         assert len(s)==3
         assert s[0]>=s[1]>=s[2]
 
-    def check_simple_underdet_complex(self):
+    def test_simple_underdet_complex(self):
         a = [[1,2,3],[4,5j,6]]
         s = svdvals(a)
         assert len(s)==2
         assert s[0]>=s[1]
 
-    def check_simple_overdet_complex(self):
+    def test_simple_overdet_complex(self):
         a = [[1,2],[4,5],[3j,4]]
         s = svdvals(a)
         assert len(s)==2
         assert s[0]>=s[1]
 
-class TestDiagSVD(NumpyTestCase):
+class TestDiagSVD(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         assert_array_almost_equal(diagsvd([1,0,0],3,3),[[1,0,0],[0,0,0],[0,0,0]])
 
-class TestCholesky(NumpyTestCase):
+class TestCholesky(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[8,2,3],[2,9,3],[3,3,6]]
         c = cholesky(a)
         assert_array_almost_equal(dot(transpose(c),c),a)
@@ -657,7 +662,7 @@
         a = dot(c,transpose(c))
         assert_array_almost_equal(cholesky(a,lower=1),c)
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         m = array([[3+1j,3+4j,5],[0,2+2j,2+7j],[0,0,7+4j]])
         a = dot(transpose(conjugate(m)),m)
         c = cholesky(a)
@@ -667,7 +672,7 @@
         a = dot(c,transpose(conjugate(c)))
         assert_array_almost_equal(cholesky(a,lower=1),c)
 
-    def check_random(self):
+    def test_random(self):
         n = 20
         for k in range(2):
             m = random([n,n])
@@ -681,7 +686,7 @@
             a = dot(c,transpose(c))
             assert_array_almost_equal(cholesky(a,lower=1),c)
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         n = 20
         for k in range(2):
             m = random([n,n])+1j*random([n,n])
@@ -696,28 +701,28 @@
             assert_array_almost_equal(cholesky(a,lower=1),c)
 
 
-class TestQR(NumpyTestCase):
+class TestQR(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[8,2,3],[2,9,3],[5,3,6]]
         q,r = qr(a)
         assert_array_almost_equal(dot(transpose(q),q),identity(3))
         assert_array_almost_equal(dot(q,r),a)
 
-    def check_simple_trap(self):
+    def test_simple_trap(self):
         a = [[8,2,3],[2,9,3]]
         q,r = qr(a)
         assert_array_almost_equal(dot(transpose(q),q),identity(2))
         assert_array_almost_equal(dot(q,r),a)
 
-    def check_simple_tall(self):
+    def test_simple_tall(self):
         # full version
         a = [[8,2],[2,9],[5,3]]
         q,r = qr(a)
         assert_array_almost_equal(dot(transpose(q),q),identity(3))
         assert_array_almost_equal(dot(q,r),a)
 
-    def check_simple_tall_e(self):
+    def test_simple_tall_e(self):
         # economy version
         a = [[8,2],[2,9],[5,3]]
         q,r = qr(a,econ=True)
@@ -726,13 +731,13 @@
         assert_equal(q.shape, (3,2))
         assert_equal(r.shape, (2,2))
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = [[3,3+4j,5],[5,2,2+7j],[3,2,7]]
         q,r = qr(a)
         assert_array_almost_equal(dot(conj(transpose(q)),q),identity(3))
         assert_array_almost_equal(dot(q,r),a)
 
-    def check_random(self):
+    def test_random(self):
         n = 20
         for k in range(2):
             a = random([n,n])
@@ -740,7 +745,7 @@
             assert_array_almost_equal(dot(transpose(q),q),identity(n))
             assert_array_almost_equal(dot(q,r),a)
 
-    def check_random_tall(self):
+    def test_random_tall(self):
         # full version
         m = 200
         n = 100
@@ -750,7 +755,7 @@
             assert_array_almost_equal(dot(transpose(q),q),identity(m))
             assert_array_almost_equal(dot(q,r),a)
 
-    def check_random_tall_e(self):
+    def test_random_tall_e(self):
         # economy version
         m = 200
         n = 100
@@ -762,7 +767,7 @@
             assert_equal(q.shape, (m,n))
             assert_equal(r.shape, (n,n))
 
-    def check_random_trap(self):
+    def test_random_trap(self):
         m = 100
         n = 200
         for k in range(2):
@@ -771,7 +776,7 @@
             assert_array_almost_equal(dot(transpose(q),q),identity(m))
             assert_array_almost_equal(dot(q,r),a)
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         n = 20
         for k in range(2):
             a = random([n,n])+1j*random([n,n])
@@ -779,15 +784,15 @@
             assert_array_almost_equal(dot(conj(transpose(q)),q),identity(n))
             assert_array_almost_equal(dot(q,r),a)
 
-class TestRQ(NumpyTestCase):
+class TestRQ(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[8,2,3],[2,9,3],[5,3,6]]
         r,q = rq(a)
         assert_array_almost_equal(dot(transpose(q),q),identity(3))
         assert_array_almost_equal(dot(r,q),a)
 
-    def check_random(self):
+    def test_random(self):
         n = 20
         for k in range(2):
             a = random([n,n])
@@ -797,25 +802,25 @@
 
 # TODO: implement support for non-square and complex arrays
 
-##    def check_simple_trap(self):
+##    def test_simple_trap(self):
 ##        a = [[8,2,3],[2,9,3]]
 ##        r,q = rq(a)
 ##        assert_array_almost_equal(dot(transpose(q),q),identity(2))
 ##        assert_array_almost_equal(dot(r,q),a)
 
-##    def check_simple_tall(self):
+##    def test_simple_tall(self):
 ##        a = [[8,2],[2,9],[5,3]]
 ##        r,q = rq(a)
 ##        assert_array_almost_equal(dot(transpose(q),q),identity(3))
 ##        assert_array_almost_equal(dot(r,q),a)
 
-##    def check_simple_complex(self):
+##    def test_simple_complex(self):
 ##        a = [[3,3+4j,5],[5,2,2+7j],[3,2,7]]
 ##        r,q = rq(a)
 ##        assert_array_almost_equal(dot(conj(transpose(q)),q),identity(3))
 ##        assert_array_almost_equal(dot(r,q),a)
 
-##    def check_random_tall(self):
+##    def test_random_tall(self):
 ##        m = 200
 ##        n = 100
 ##        for k in range(2):
@@ -824,7 +829,7 @@
 ##            assert_array_almost_equal(dot(transpose(q),q),identity(m))
 ##            assert_array_almost_equal(dot(r,q),a)
 
-##    def check_random_trap(self):
+##    def test_random_trap(self):
 ##        m = 100
 ##        n = 200
 ##        for k in range(2):
@@ -833,7 +838,7 @@
 ##            assert_array_almost_equal(dot(transpose(q),q),identity(m))
 ##            assert_array_almost_equal(dot(r,q),a)
 
-##    def check_random_complex(self):
+##    def test_random_complex(self):
 ##        n = 20
 ##        for k in range(2):
 ##            a = random([n,n])+1j*random([n,n])
@@ -844,9 +849,9 @@
 transp = transpose
 any = sometrue
 
-class TestSchur(NumpyTestCase):
+class TestSchur(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[8,12,3],[2,9,3],[10,3,6]]
         t,z = schur(a)
         assert_array_almost_equal(dot(dot(z,t),transp(conj(z))),a)
@@ -856,9 +861,9 @@
         tc2,zc2 = rsf2csf(tc,zc)
         assert_array_almost_equal(dot(dot(zc2,tc2),transp(conj(zc2))),a)
 
-class TestHessenberg(NumpyTestCase):
+class TestHessenberg(TestCase):
 
-    def check_simple(self):
+    def test_simple(self):
         a = [[-149, -50,-154],
              [ 537, 180, 546],
              [ -27,  -9, -25]]
@@ -869,7 +874,7 @@
         assert_array_almost_equal(dot(transp(q),dot(a,q)),h)
         assert_array_almost_equal(h,h1,decimal=4)
 
-    def check_simple_complex(self):
+    def test_simple_complex(self):
         a = [[-149, -50,-154],
              [ 537, 180j, 546],
              [ -27j,  -9, -25]]
@@ -877,7 +882,7 @@
         h1 = dot(transp(conj(q)),dot(a,q))
         assert_array_almost_equal(h1,h)
 
-    def check_simple2(self):
+    def test_simple2(self):
         a = [[1,2,3,4,5,6,7],
              [0,2,3,4,6,7,2],
              [0,2,2,3,0,3,2],
@@ -888,14 +893,14 @@
         h,q = hessenberg(a,calc_q=1)
         assert_array_almost_equal(dot(transp(q),dot(a,q)),h)
 
-    def check_random(self):
+    def test_random(self):
         n = 20
         for k in range(2):
             a = random([n,n])
             h,q = hessenberg(a,calc_q=1)
             assert_array_almost_equal(dot(transp(q),dot(a,q)),h)
 
-    def check_random_complex(self):
+    def test_random_complex(self):
         n = 20
         for k in range(2):
             a = random([n,n])+1j*random([n,n])
@@ -905,9 +910,9 @@
 
 
 
-class TestDataNotShared(NumpyTestCase):
+class TestDataNotShared(TestCase):
 
-    def check_datanotshared(self):
+    def test_datanotshared(self):
         from scipy.linalg.decomp import _datanotshared
 
         M = matrix([[0,1],[2,3]])
@@ -924,4 +929,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/linalg/tests/test_fblas.py
===================================================================
--- trunk/scipy/linalg/tests/test_fblas.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/tests/test_fblas.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -6,14 +6,16 @@
 # !! Complex calculations really aren't checked that carefully.
 # !! Only real valued complex numbers are used in tests.
 
-from numpy import *
-
 import sys
-from numpy.testing import *
-set_package_path()
-from linalg import fblas
-restore_path()
 
+from numpy import dot, float32, float64, complex64, complex128, \
+     arange, array, zeros, shape, transpose, newaxis, \
+     common_type, conjugate
+from scipy.linalg import fblas
+
+from scipy.testing import *
+
+
 #decimal accuracy to require between Python and LAPACK/BLAS calculations
 accuracy = 5
 
@@ -40,39 +42,40 @@
 ##################################################
 ### Test blas ?axpy
 
-class BaseAxpy(NumpyTestCase):
-    def check_default_a(self):
+class BaseAxpy(object):
+    ''' Mixin class for axpy tests '''
+    def test_default_a(self):
         x = arange(3.,dtype=self.dtype)
         y = arange(3.,dtype=x.dtype)
         real_y = x*1.+y
         self.blas_func(x,y)
         assert_array_equal(real_y,y)
-    def check_simple(self):
+    def test_simple(self):
         x = arange(3.,dtype=self.dtype)
         y = arange(3.,dtype=x.dtype)
         real_y = x*3.+y
         self.blas_func(x,y,a=3.)
         assert_array_equal(real_y,y)
-    def check_x_stride(self):
+    def test_x_stride(self):
         x = arange(6.,dtype=self.dtype)
         y = zeros(3,x.dtype)
         y = arange(3.,dtype=x.dtype)
         real_y = x[::2]*3.+y
         self.blas_func(x,y,a=3.,n=3,incx=2)
         assert_array_equal(real_y,y)
-    def check_y_stride(self):
+    def test_y_stride(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         real_y = x*3.+y[::2]
         self.blas_func(x,y,a=3.,n=3,incy=2)
         assert_array_equal(real_y,y[::2])
-    def check_x_and_y_stride(self):
+    def test_x_and_y_stride(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         real_y = x[::4]*3.+y[::2]
         self.blas_func(x,y,a=3.,n=3,incx=4,incy=2)
         assert_array_equal(real_y,y[::2])
-    def check_x_bad_size(self):
+    def test_x_bad_size(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         try:
@@ -81,7 +84,7 @@
             return
         # should catch error and never get here
         assert(0)
-    def check_y_bad_size(self):
+    def test_y_bad_size(self):
         x = arange(12.,dtype=complex64)
         y = zeros(6,x.dtype)
         try:
@@ -92,21 +95,21 @@
         assert(0)
 
 try:
-    class TestSaxpy(BaseAxpy):
+    class TestSaxpy(TestCase, BaseAxpy):
         blas_func = fblas.saxpy
         dtype = float32
 except AttributeError:
     class TestSaxpy: pass
-class TestDaxpy(BaseAxpy):
+class TestDaxpy(TestCase, BaseAxpy):
     blas_func = fblas.daxpy
     dtype = float64
 try:
-    class TestCaxpy(BaseAxpy):
+    class TestCaxpy(TestCase, BaseAxpy):
         blas_func = fblas.caxpy
         dtype = complex64
 except AttributeError:
     class TestCaxpy: pass
-class TestZaxpy(BaseAxpy):
+class TestZaxpy(TestCase, BaseAxpy):
     blas_func = fblas.zaxpy
     dtype = complex128
 
@@ -114,19 +117,20 @@
 ##################################################
 ### Test blas ?scal
 
-class BaseScal(NumpyTestCase):
-    def check_simple(self):
+class BaseScal(object):
+    ''' Mixin class for scal testing '''
+    def test_simple(self):
         x = arange(3.,dtype=self.dtype)
         real_x = x*3.
         self.blas_func(3.,x)
         assert_array_equal(real_x,x)
-    def check_x_stride(self):
+    def test_x_stride(self):
         x = arange(6.,dtype=self.dtype)
         real_x = x.copy()
         real_x[::2] = x[::2]*array(3.,self.dtype)
         self.blas_func(3.,x,n=3,incx=2)
         assert_array_equal(real_x,x)
-    def check_x_bad_size(self):
+    def test_x_bad_size(self):
         x = arange(12.,dtype=self.dtype)
         try:
             self.blas_func(2.,x,n=4,incx=5)
@@ -135,21 +139,21 @@
         # should catch error and never get here
         assert(0)
 try:
-    class TestSscal(BaseScal):
+    class TestSscal(TestCase, BaseScal):
         blas_func = fblas.sscal
         dtype = float32
 except AttributeError:
     class TestSscal: pass
-class TestDscal(BaseScal):
+class TestDscal(TestCase, BaseScal):
     blas_func = fblas.dscal
     dtype = float64
 try:
-    class TestCscal(BaseScal):
+    class TestCscal(TestCase, BaseScal):
         blas_func = fblas.cscal
         dtype = complex64
 except AttributeError:
     class TestCscal: pass
-class TestZscal(BaseScal):
+class TestZscal(TestCase, BaseScal):
     blas_func = fblas.zscal
     dtype = complex128
 
@@ -159,28 +163,29 @@
 ##################################################
 ### Test blas ?copy
 
-class BaseCopy(NumpyTestCase):
-    def check_simple(self):
+class BaseCopy(object):
+    ''' Mixin class for copy testing '''
+    def test_simple(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(shape(x),x.dtype)
         self.blas_func(x,y)
         assert_array_equal(x,y)
-    def check_x_stride(self):
+    def test_x_stride(self):
         x = arange(6.,dtype=self.dtype)
         y = zeros(3,x.dtype)
         self.blas_func(x,y,n=3,incx=2)
         assert_array_equal(x[::2],y)
-    def check_y_stride(self):
+    def test_y_stride(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         self.blas_func(x,y,n=3,incy=2)
         assert_array_equal(x,y[::2])
-    def check_x_and_y_stride(self):
+    def test_x_and_y_stride(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         self.blas_func(x,y,n=3,incx=4,incy=2)
         assert_array_equal(x[::4],y[::2])
-    def check_x_bad_size(self):
+    def test_x_bad_size(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         try:
@@ -189,7 +194,7 @@
             return
         # should catch error and never get here
         assert(0)
-    def check_y_bad_size(self):
+    def test_y_bad_size(self):
         x = arange(12.,dtype=complex64)
         y = zeros(6,x.dtype)
         try:
@@ -198,7 +203,7 @@
             return
         # should catch error and never get here
         assert(0)
-    #def check_y_bad_type(self):
+    #def test_y_bad_type(self):
     ##   Hmmm. Should this work?  What should be the output.
     #    x = arange(3.,dtype=self.dtype)
     #    y = zeros(shape(x))
@@ -206,21 +211,21 @@
     #    assert_array_equal(x,y)
 
 try:
-    class TestScopy(BaseCopy):
+    class TestScopy(TestCase, BaseCopy):
         blas_func = fblas.scopy
         dtype = float32
 except AttributeError:
     class TestScopy: pass
-class TestDcopy(BaseCopy):
+class TestDcopy(TestCase, BaseCopy):
     blas_func = fblas.dcopy
     dtype = float64
 try:
-    class TestCcopy(BaseCopy):
+    class TestCcopy(TestCase, BaseCopy):
         blas_func = fblas.ccopy
         dtype = complex64
 except AttributeError:
     class TestCcopy: pass
-class TestZcopy(BaseCopy):
+class TestZcopy(TestCase, BaseCopy):
     blas_func = fblas.zcopy
     dtype = complex128
 
@@ -228,8 +233,9 @@
 ##################################################
 ### Test blas ?swap
 
-class BaseSwap(NumpyTestCase):
-    def check_simple(self):
+class BaseSwap(object):
+    ''' Mixin class for swap tests '''
+    def test_simple(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(shape(x),x.dtype)
         desired_x = y.copy()
@@ -237,7 +243,7 @@
         self.blas_func(x,y)
         assert_array_equal(desired_x,x)
         assert_array_equal(desired_y,y)
-    def check_x_stride(self):
+    def test_x_stride(self):
         x = arange(6.,dtype=self.dtype)
         y = zeros(3,x.dtype)
         desired_x = y.copy()
@@ -245,7 +251,7 @@
         self.blas_func(x,y,n=3,incx=2)
         assert_array_equal(desired_x,x[::2])
         assert_array_equal(desired_y,y)
-    def check_y_stride(self):
+    def test_y_stride(self):
         x = arange(3.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         desired_x = y.copy()[::2]
@@ -254,7 +260,7 @@
         assert_array_equal(desired_x,x)
         assert_array_equal(desired_y,y[::2])
 
-    def check_x_and_y_stride(self):
+    def test_x_and_y_stride(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         desired_x = y.copy()[::2]
@@ -262,7 +268,7 @@
         self.blas_func(x,y,n=3,incx=4,incy=2)
         assert_array_equal(desired_x,x[::4])
         assert_array_equal(desired_y,y[::2])
-    def check_x_bad_size(self):
+    def test_x_bad_size(self):
         x = arange(12.,dtype=self.dtype)
         y = zeros(6,x.dtype)
         try:
@@ -271,7 +277,7 @@
             return
         # should catch error and never get here
         assert(0)
-    def check_y_bad_size(self):
+    def test_y_bad_size(self):
         x = arange(12.,dtype=complex64)
         y = zeros(6,x.dtype)
         try:
@@ -282,21 +288,21 @@
         assert(0)
 
 try:
-    class TestSswap(BaseSwap):
+    class TestSswap(TestCase, BaseSwap):
         blas_func = fblas.sswap
         dtype = float32
 except AttributeError:
     class TestSswap: pass
-class TestDswap(BaseSwap):
+class TestDswap(TestCase, BaseSwap):
     blas_func = fblas.dswap
     dtype = float64
 try:
-    class TestCswap(BaseSwap):
+    class TestCswap(TestCase, BaseSwap):
         blas_func = fblas.cswap
         dtype = complex64
 except AttributeError:
     class TestCswap: pass
-class TestZswap(BaseSwap):
+class TestZswap(TestCase, BaseSwap):
     blas_func = fblas.zswap
     dtype = complex128
 
@@ -304,7 +310,8 @@
 ### Test blas ?gemv
 ### This will be a mess to test all cases.
 
-class BaseGemv(NumpyTestCase):
+class BaseGemv(object):
+    ''' Mixin class for gemv tests '''
     def get_data(self,x_stride=1,y_stride=1):
         mult = array(1, dtype = self.dtype)
         if self.dtype in [complex64, complex128]:
@@ -316,37 +323,37 @@
         x = arange(shape(a)[0]*x_stride,dtype=self.dtype) * mult
         y = arange(shape(a)[1]*y_stride,dtype=self.dtype) * mult
         return alpha,beta,a,x,y
-    def check_simple(self):
+    def test_simple(self):
         alpha,beta,a,x,y = self.get_data()
         desired_y = alpha*matrixmultiply(a,x)+beta*y
         y = self.blas_func(alpha,a,x,beta,y)
         assert_array_almost_equal(desired_y,y)
-    def check_default_beta_y(self):
+    def test_default_beta_y(self):
         alpha,beta,a,x,y = self.get_data()
         desired_y = matrixmultiply(a,x)
         y = self.blas_func(1,a,x)
         assert_array_almost_equal(desired_y,y)
-    def check_simple_transpose(self):
+    def test_simple_transpose(self):
         alpha,beta,a,x,y = self.get_data()
         desired_y = alpha*matrixmultiply(transpose(a),x)+beta*y
         y = self.blas_func(alpha,a,x,beta,y,trans=1)
         assert_array_almost_equal(desired_y,y)
-    def check_simple_transpose_conj(self):
+    def test_simple_transpose_conj(self):
         alpha,beta,a,x,y = self.get_data()
         desired_y = alpha*matrixmultiply(transpose(conjugate(a)),x)+beta*y
         y = self.blas_func(alpha,a,x,beta,y,trans=2)
         assert_array_almost_equal(desired_y,y)
-    def check_x_stride(self):
+    def test_x_stride(self):
         alpha,beta,a,x,y = self.get_data(x_stride=2)
         desired_y = alpha*matrixmultiply(a,x[::2])+beta*y
         y = self.blas_func(alpha,a,x,beta,y,incx=2)
         assert_array_almost_equal(desired_y,y)
-    def check_x_stride_transpose(self):
+    def test_x_stride_transpose(self):
         alpha,beta,a,x,y = self.get_data(x_stride=2)
         desired_y = alpha*matrixmultiply(transpose(a),x[::2])+beta*y
         y = self.blas_func(alpha,a,x,beta,y,trans=1,incx=2)
         assert_array_almost_equal(desired_y,y)
-    def check_x_stride_assert(self):
+    def test_x_stride_assert(self):
         # What is the use of this test?
         alpha,beta,a,x,y = self.get_data(x_stride=2)
         try:
@@ -359,19 +366,19 @@
             assert(0)
         except:
             pass
-    def check_y_stride(self):
+    def test_y_stride(self):
         alpha,beta,a,x,y = self.get_data(y_stride=2)
         desired_y = y.copy()
         desired_y[::2] = alpha*matrixmultiply(a,x)+beta*y[::2]
         y = self.blas_func(alpha,a,x,beta,y,incy=2)
         assert_array_almost_equal(desired_y,y)
-    def check_y_stride_transpose(self):
+    def test_y_stride_transpose(self):
         alpha,beta,a,x,y = self.get_data(y_stride=2)
         desired_y = y.copy()
         desired_y[::2] = alpha*matrixmultiply(transpose(a),x)+beta*y[::2]
         y = self.blas_func(alpha,a,x,beta,y,trans=1,incy=2)
         assert_array_almost_equal(desired_y,y)
-    def check_y_stride_assert(self):
+    def test_y_stride_assert(self):
         # What is the use of this test?
         alpha,beta,a,x,y = self.get_data(y_stride=2)
         try:
@@ -386,21 +393,21 @@
             pass
 
 try:
-    class TestSgemv(BaseGemv):
+    class TestSgemv(TestCase, BaseGemv):
         blas_func = fblas.sgemv
         dtype = float32
 except AttributeError:
     class TestSgemv: pass
-class TestDgemv(BaseGemv):
+class TestDgemv(TestCase, BaseGemv):
     blas_func = fblas.dgemv
     dtype = float64
 try:
-    class TestCgemv(BaseGemv):
+    class TestCgemv(TestCase, BaseGemv):
         blas_func = fblas.cgemv
         dtype = complex64
 except AttributeError:
     class TestCgemv: pass
-class TestZgemv(BaseGemv):
+class TestZgemv(TestCase, BaseGemv):
     blas_func = fblas.zgemv
     dtype = complex128
 
@@ -409,7 +416,7 @@
 ### Test blas ?ger
 ### This will be a mess to test all cases.
 
-class BaseGer(NumpyTestCase):
+class BaseGer(TestCase):
     def get_data(self,x_stride=1,y_stride=1):
         from numpy.random import normal
         alpha = array(1., dtype = self.dtype)
@@ -417,31 +424,31 @@
         x = arange(shape(a)[0]*x_stride,dtype=self.dtype)
         y = arange(shape(a)[1]*y_stride,dtype=self.dtype)
         return alpha,a,x,y
-    def check_simple(self):
+    def test_simple(self):
         alpha,a,x,y = self.get_data()
         # tranpose takes care of Fortran vs. C(and Python) memory layout
         desired_a = alpha*transpose(x[:,newaxis]*y) + a
         self.blas_func(x,y,a)
         assert_array_almost_equal(desired_a,a)
-    def check_x_stride(self):
+    def test_x_stride(self):
         alpha,a,x,y = self.get_data(x_stride=2)
         desired_a = alpha*transpose(x[::2,newaxis]*y) + a
         self.blas_func(x,y,a,incx=2)
         assert_array_almost_equal(desired_a,a)
-    def check_x_stride_assert(self):
+    def test_x_stride_assert(self):
         alpha,a,x,y = self.get_data(x_stride=2)
         try:
             self.blas_func(x,y,a,incx=3)
             assert(0)
         except:
             pass
-    def check_y_stride(self):
+    def test_y_stride(self):
         alpha,a,x,y = self.get_data(y_stride=2)
         desired_a = alpha*transpose(x[:,newaxis]*y[::2]) + a
         self.blas_func(x,y,a,incy=2)
         assert_array_almost_equal(desired_a,a)
 
-    def check_y_stride_assert(self):
+    def test_y_stride_assert(self):
         alpha,a,x,y = self.get_data(y_stride=2)
         try:
             self.blas_func(a,x,y,incy=3)
@@ -472,7 +479,7 @@
         y = normal(0.,1.,shape(a)[1]*y_stride).astype(self.dtype)
         y = y + y * array(1j, dtype = self.dtype)
         return alpha,a,x,y
-    def check_simple(self):
+    def test_simple(self):
         alpha,a,x,y = self.get_data()
         # tranpose takes care of Fortran vs. C(and Python) memory layout
         a = a * array(0.,dtype = self.dtype)
@@ -482,12 +489,12 @@
         fblas.cgeru(x,y,a,alpha = alpha)
         assert_array_almost_equal(desired_a,a)
 
-    #def check_x_stride(self):
+    #def test_x_stride(self):
     #    alpha,a,x,y = self.get_data(x_stride=2)
     #    desired_a = alpha*transpose(x[::2,newaxis]*self.transform(y)) + a
     #    self.blas_func(x,y,a,incx=2)
     #    assert_array_almost_equal(desired_a,a)
-    #def check_y_stride(self):
+    #def test_y_stride(self):
     #    alpha,a,x,y = self.get_data(y_stride=2)
     #    desired_a = alpha*transpose(x[:,newaxis]*self.transform(y[::2])) + a
     #    self.blas_func(x,y,a,incy=2)
@@ -518,4 +525,4 @@
 """
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/linalg/tests/test_iterative.py
===================================================================
--- trunk/scipy/linalg/tests/test_iterative.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/tests/test_iterative.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -13,15 +13,14 @@
   python tests/test_iterative.py [<level>]
 """
 
+import sys
+
 from numpy import zeros, dot, diag, ones
-from numpy.testing import *
+from scipy.testing import *
 from numpy.random import rand
 #from numpy import arange, add, array, dot, zeros, identity, conjugate, transpose
 
-import sys
-set_package_path()
-from linalg import iterative, norm, cg, cgs, bicg, bicgstab, gmres, qmr
-restore_path()
+from scipy.linalg import iterative, norm, cg, cgs, bicg, bicgstab, gmres, qmr
 
 
 def callback(x):
@@ -29,9 +28,9 @@
     res = b-dot(A,x)
     #print "||A.x - b|| = " + str(norm(dot(A,x)-b))
 
-class TestIterativeSolvers(NumpyTestCase):
+class TestIterativeSolvers(TestCase):
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         self.setUp()
     def setUp (self):
         global A, b
@@ -44,41 +43,41 @@
         self.b = rand(n)
         b = self.b
 
-    def check_cg(self):
+    def test_cg(self):
         bx0 = self.x0.copy()
         x, info = cg(self.A, self.b, self.x0, callback=callback)
         assert_array_equal(bx0, self.x0)
         assert norm(dot(self.A, x) - self.b) < 5*self.tol
 
-    def check_bicg(self):
+    def test_bicg(self):
         bx0 = self.x0.copy()
         x, info = bicg(self.A, self.b, self.x0, callback=callback)
         assert_array_equal(bx0, self.x0)
         assert norm(dot(self.A, x) - self.b) < 5*self.tol
 
-    def check_cgs(self):
+    def test_cgs(self):
         bx0 = self.x0.copy()
         x, info = cgs(self.A, self.b, self.x0, callback=callback)
         assert_array_equal(bx0, self.x0)
         assert norm(dot(self.A, x) - self.b) < 5*self.tol
 
-    def check_bicgstab(self):
+    def test_bicgstab(self):
         bx0 = self.x0.copy()
         x, info = bicgstab(self.A, self.b, self.x0, callback=callback)
         assert_array_equal(bx0, self.x0)
         assert norm(dot(self.A, x) - self.b) < 5*self.tol
 
-    def check_gmres(self):
+    def test_gmres(self):
         bx0 = self.x0.copy()
         x, info = gmres(self.A, self.b, self.x0, callback=callback)
         assert_array_equal(bx0, self.x0)
         assert norm(dot(self.A, x) - self.b) < 5*self.tol
 
-    def check_qmr(self):
+    def test_qmr(self):
         bx0 = self.x0.copy()
         x, info = qmr(self.A, self.b, self.x0, callback=callback)
         assert_array_equal(bx0, self.x0)
         assert norm(dot(self.A, x) - self.b) < 5*self.tol
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/linalg/tests/test_lapack.py
===================================================================
--- trunk/scipy/linalg/tests/test_lapack.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/tests/test_lapack.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,26 +3,17 @@
 # Created by: Pearu Peterson, September 2002
 #
 
-__usage__ = """
-Build linalg:
-  python setup_linalg.py build
-Run tests if scipy is installed:
-  python -c 'import scipy;scipy.linalg.test(<level>)'
-Run tests if linalg is not installed:
-  python tests/test_lapack.py [<level>]
-"""
 
 import sys
-from numpy.testing import *
+from scipy.testing import *
 from numpy import ones
-set_package_path()
-from linalg import flapack
-from linalg import clapack
-restore_path()
 
-class TestFlapackSimple(NumpyTestCase):
+from scipy.linalg import flapack, clapack
 
-    def check_gebal(self):
+
+class TestFlapackSimple(TestCase):
+
+    def test_gebal(self):
         a = [[1,2,3],[4,5,6],[7,8,9]]
         a1 = [[1,0,0,3e-4],
               [4,0,0,2e-3],
@@ -42,7 +33,7 @@
             #print a1
             #print ba,lo,hi,pivscale
 
-    def check_gehrd(self):
+    def test_gehrd(self):
         a = [[-149, -50,-154],
              [ 537, 180, 546],
              [ -27,  -9, -25]]
@@ -52,9 +43,9 @@
             ht,tau,info = f(a)
             assert not info,`info`
 
-class TestLapack(NumpyTestCase):
+class TestLapack(TestCase):
 
-    def check_flapack(self):
+    def test_flapack(self):
         if hasattr(flapack,'empty_module'):
             print """
 ****************************************************************
@@ -63,7 +54,7 @@
 See scipy/INSTALL.txt for troubleshooting.
 ****************************************************************
 """
-    def check_clapack(self):
+    def test_clapack(self):
         if hasattr(clapack,'empty_module'):
             print """
 ****************************************************************
@@ -77,4 +68,4 @@
 """
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/linalg/tests/test_matfuncs.py
===================================================================
--- trunk/scipy/linalg/tests/test_matfuncs.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linalg/tests/test_matfuncs.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -5,29 +5,21 @@
 """ Test functions for linalg.matfuncs module
 
 """
-__usage__ = """
-Build linalg:
-  python setup_linalg.py build
-Run tests if scipy is installed:
-  python -c 'import scipy;scipy.linalg.test(<level>)'
-Run tests if linalg is not installed:
-  python tests/test_matfuncs.py [<level>]
-"""
 
-from numpy import array, identity
-
 import sys
-from numpy.testing import *
-set_package_path()
+
 import numpy
-from numpy import dot,sqrt
-import linalg
-from linalg import signm,logm,funm, sqrtm, expm, expm2, expm3
-restore_path()
+from numpy import array, identity, dot, sqrt
 
-class TestSignM(NumpyTestCase):
+from scipy.testing import *
 
-    def check_nils(self):
+import scipy.linalg
+from scipy.linalg import signm,logm,funm, sqrtm, expm, expm2, expm3
+
+
+class TestSignM(TestCase):
+
+    def test_nils(self):
         a = array([[ 29.2, -24.2,  69.5,  49.8,   7. ],
                    [ -9.2,   5.2, -18. , -16.8,  -2. ],
                    [-10. ,   6. , -20. , -18. ,  -2. ],
@@ -41,12 +33,12 @@
         r = signm(a)
         assert_array_almost_equal(r,cr)
 
-    def check_defective1(self):
+    def test_defective1(self):
         a = array([[0.0,1,0,0],[1,0,1,0],[0,0,0,1],[0,0,1,0]])
         r = signm(a)
         #XXX: what would be the correct result?
 
-    def check_defective2(self):
+    def test_defective2(self):
         a = array((
             [29.2,-24.2,69.5,49.8,7.0],
             [-9.2,5.2,-18.0,-16.8,-2.0],
@@ -56,7 +48,7 @@
         r = signm(a)
         #XXX: what would be the correct result?
 
-    def check_defective3(self):
+    def test_defective3(self):
         a = array([[ -2.,  25.,   0.,   0.,   0.,   0.,   0.],
                    [  0.,  -3.,  10.,   3.,   3.,   3.,   0.],
                    [  0.,   0.,   2.,  15.,   3.,   3.,   0.],
@@ -67,9 +59,9 @@
         r = signm(a)
         #XXX: what would be the correct result?
 
-class TestLogM(NumpyTestCase):
+class TestLogM(TestCase):
 
-    def check_nils(self):
+    def test_nils(self):
         a = array([[ -2.,  25.,   0.,   0.,   0.,   0.,   0.],
                    [  0.,  -3.,  10.,   3.,   3.,   3.,   0.],
                    [  0.,   0.,   2.,  15.,   3.,   3.,   0.],
@@ -81,8 +73,8 @@
         logm(m)
 
 
-class TestSqrtM(NumpyTestCase):
-    def check_bad(self):
+class TestSqrtM(TestCase):
+    def test_bad(self):
         # See http://www.maths.man.ac.uk/~nareports/narep336.ps.gz
         e = 2**-5
         se = sqrt(e)
@@ -98,12 +90,12 @@
         esa = sqrtm(a)
         assert_array_almost_equal(dot(esa,esa),a)
 
-class TestExpM(NumpyTestCase):
-    def check_zero(self):
+class TestExpM(TestCase):
+    def test_zero(self):
         a = array([[0.,0],[0,0]])
         assert_array_almost_equal(expm(a),[[1,0],[0,1]])
         assert_array_almost_equal(expm2(a),[[1,0],[0,1]])
         assert_array_almost_equal(expm3(a),[[1,0],[0,1]])
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/linsolve/__init__.py
===================================================================
--- trunk/scipy/linsolve/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linsolve/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -9,5 +9,5 @@
 from linsolve import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/linsolve/umfpack/__init__.py
===================================================================
--- trunk/scipy/linsolve/umfpack/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linsolve/umfpack/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,5 +3,5 @@
 from umfpack import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/linsolve/umfpack/tests/test_umfpack.py
===================================================================
--- trunk/scipy/linsolve/umfpack/tests/test_umfpack.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/linsolve/umfpack/tests/test_umfpack.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -8,20 +8,23 @@
 from numpy import transpose, array, arange
 
 import random
-from numpy.testing import *
-set_package_path()
+from scipy.testing import *
+
 from scipy import linsolve, rand, matrix, diag, eye
 from scipy.sparse import csc_matrix, dok_matrix, spdiags
 
 import numpy as nm
 import scipy.linsolve.umfpack as um
 
-restore_path()
+# Allow disabling of nose tests if umfpack not present
+have_umfpack = um.umfpack._um is not None
 
-class TestSolvers(NumpyTestCase):
+class TestSolvers(TestCase):
     """Tests inverting a sparse linear system"""
 
-    def check_solve_complex_without_umfpack(self):
+    __test__ = have_umfpack
+    
+    def test_solve_complex_without_umfpack(self):
         """Solve: single precision complex"""
         linsolve.use_solver( useUmfpack = False )
         a = self.a.astype('F')
@@ -32,7 +35,7 @@
         assert_array_almost_equal(a*x, b)
 
 
-    def check_solve_without_umfpack(self):
+    def test_solve_without_umfpack(self):
         """Solve: single precision"""
         linsolve.use_solver( useUmfpack = False )
         a = self.a.astype('f')
@@ -43,7 +46,7 @@
         assert_array_almost_equal(a*x, b)
 
 
-    def check_solve_complex_umfpack(self):
+    def test_solve_complex_umfpack(self):
         """Solve with UMFPACK: double precision complex"""
         linsolve.use_solver( useUmfpack = True )
         a = self.a.astype('D')
@@ -53,7 +56,7 @@
         #print "Error: ", a*x-b
         assert_array_almost_equal(a*x, b)
 
-    def check_solve_umfpack(self):
+    def test_solve_umfpack(self):
         """Solve with UMFPACK: double precision"""
         linsolve.use_solver( useUmfpack = True )
         a = self.a.astype('d')
@@ -63,7 +66,7 @@
         #print "Error: ", a*x-b
         assert_array_almost_equal(a*x, b)
 
-    def check_solve_sparse_rhs(self):
+    def test_solve_sparse_rhs(self):
         """Solve with UMFPACK: double precision, sparse rhs"""
         linsolve.use_solver( useUmfpack = True )
         a = self.a.astype('d')
@@ -73,7 +76,7 @@
         #print "Error: ", a*x-b
         assert_array_almost_equal(a*x, self.b)
 
-    def check_factorized_umfpack(self):
+    def test_factorized_umfpack(self):
         """Prefactorize (with UMFPACK) matrix for solving with multiple rhs"""
         linsolve.use_solver( useUmfpack = True )
         a = self.a.astype('d')
@@ -84,7 +87,7 @@
         x2 = solve( self.b2 )
         assert_array_almost_equal(a*x2, self.b2)
 
-    def check_factorized_without_umfpack(self):
+    def test_factorized_without_umfpack(self):
         """Prefactorize matrix for solving with multiple rhs"""
         linsolve.use_solver( useUmfpack = False )
         a = self.a.astype('d')
@@ -104,10 +107,12 @@
 
 
 
-class TestFactorization(NumpyTestCase):
+class TestFactorization(TestCase):
     """Tests factorizing a sparse linear system"""
 
-    def check_complex_lu(self):
+    __test__ = have_umfpack
+
+    def test_complex_lu(self):
         """Getting factors of complex matrix"""
         umfpack = um.UmfpackContext("zi")
 
@@ -126,7 +131,7 @@
 
             assert_array_almost_equal(P*R*A*Q,L*U)
 
-    def check_real_lu(self):
+    def test_real_lu(self):
         """Getting factors of real matrix"""
         umfpack = um.UmfpackContext("di")
 
@@ -166,4 +171,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/maxentropy/__init__.py
===================================================================
--- trunk/scipy/maxentropy/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/maxentropy/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -8,5 +8,5 @@
 from info import __doc__
 from maxentropy import *
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/maxentropy/tests/test_maxentropy.py
===================================================================
--- trunk/scipy/maxentropy/tests/test_maxentropy.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/maxentropy/tests/test_maxentropy.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -7,20 +7,15 @@
 """
 
 import sys
-from numpy.testing import *
+from scipy.testing import *
 from numpy import arange, add, array, dot, zeros, identity, log, exp, ones
-set_package_path()
 from scipy.maxentropy.maxentropy import *
-restore_path()
 
-import unittest
-
-
-class TestMaxentropy(NumpyTestCase):
+class TestMaxentropy(TestCase):
     """Test whether logsumexp() function correctly handles large
     inputs.
     """
-    def check_logsumexp(self, level=1):
+    def test_logsumexp(self):
         a = arange(200)
         desired = log(sum(exp(a)))
         assert_almost_equal(logsumexp(a), desired)
@@ -35,10 +30,10 @@
         desired = 10000.0 + log(n)
         assert_almost_equal(logsumexp(b), desired)
 
-    def check_simple(self, level=1):
+    def test_simple(self):
         # Write me!
         pass
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/misc/__init__.py
===================================================================
--- trunk/scipy/misc/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/misc/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -20,5 +20,5 @@
 
 __all__ += common.__all__
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/misc/ppimport.py
===================================================================
--- trunk/scipy/misc/ppimport.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/misc/ppimport.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -242,8 +242,8 @@
         self.__dict__['_ppimport_p_frame'] = p_frame
 
         if location != 'sys.path':
-            from numpy.test.testing import NumpyTest
-            self.__dict__['test'] = NumpyTest(self).test
+            from scipy.testing.pkgtester import Tester
+            self.__dict__['test'] = Tester(os,path.dirname(location)).test
 
         # install loader
         sys.modules[name] = self
@@ -283,9 +283,8 @@
         self.__dict__['_ppimport_module'] = module
 
         # XXX: Should we check the existence of module.test? Warn?
-        from numpy.test.testing import NumpyTest
-        module.test = NumpyTest(module).test
-
+        from scipy.testing.pkgtester import Tester
+        test = Tester(os.path.dirname(module).test
         return module
 
     def __setattr__(self, name, value):

Modified: trunk/scipy/misc/tests/test_pilutil.py
===================================================================
--- trunk/scipy/misc/tests/test_pilutil.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/misc/tests/test_pilutil.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,16 +1,15 @@
-from numpy.testing import *
-set_package_path()
+import os.path
+import glob
+import numpy as N
+
+from scipy.testing import *
+
 import PIL.Image
 import scipy.misc.pilutil as pilutil
-restore_path()
 
-import glob
-import os.path
-import numpy as N
-
 datapath = os.path.dirname(__file__)
 
-class TestPILUtil(ParametricTestCase):
+class TestPILUtil(TestCase):
     def test_imresize(self):
         im = N.random.random((10,20))
         for T in N.sctypes['float'] + [float]:
@@ -23,19 +22,20 @@
         assert_equal(pilutil.bytescale(x),x)
         assert_equal(pilutil.bytescale(y),[0,127,255])
 
-    def tst_fromimage(self,filename,irange):
-        img = pilutil.fromimage(PIL.Image.open(filename))
-        imin,imax = irange
-        assert img.min() >= imin
-        assert img.max() <= imax
 
-    def testip_fromimage(self):
-        data = {'icon.png':(0,255),
-                'icon_mono.png':(0,2),
-                'icon_mono_flat.png':(0,1)}
+def tst_fromimage(filename, irange):
+    img = pilutil.fromimage(PIL.Image.open(filename))
+    imin,imax = irange
+    assert img.min() >= imin
+    assert img.max() <= imax
 
-        return ((self.tst_fromimage,os.path.join(datapath,'data',fn),irange)
-                for fn,irange in data.iteritems())
+def test_fromimage():
+    ''' Test generator for parametric tests '''
+    data = {'icon.png':(0,255),
+            'icon_mono.png':(0,2),
+            'icon_mono_flat.png':(0,1)}
+    for fn, irange in data.iteritems():
+        yield tst_fromimage, os.path.join(datapath,'data',fn), irange
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/ndimage/__init__.py
===================================================================
--- trunk/scipy/ndimage/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/ndimage/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -36,6 +36,7 @@
 from morphology import *
 
 from info import __doc__
-from numpy.testing import NumpyTest
-test = NumpyTest().test
 __version__ = '2.0'
+
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/ndimage/segment/tests/test_segment.py
===================================================================
--- trunk/scipy/ndimage/segment/tests/test_segment.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/ndimage/segment/tests/test_segment.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,6 +1,6 @@
 
 import numpy as N
-from numpy.testing import *
+from scipy.testing import *
 import scipy.ndimage.segment as S
 
 inputname = 'slice112.raw'
@@ -291,7 +291,7 @@
     slice.tofile(filename)
 
 
-class TestSegment(NumpyTestCase):
+class TestSegment(TestCase):
     def test1(self):
         image = get_slice(filename)
         sourceImage = image.copy()
@@ -310,4 +310,4 @@
 
     
 if __name__ == "__main__":
-    NumpyTest().run()
+    inittest.main()

Modified: trunk/scipy/ndimage/tests/test_ndimage.py
===================================================================
--- trunk/scipy/ndimage/tests/test_ndimage.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/ndimage/tests/test_ndimage.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -28,21 +28,12 @@
 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-import sys
-import unittest
 import math
 import numpy
 from numpy import fft
-from numpy.testing import *
-set_package_path()
-try:
-    import scipy.ndimage as ndimage
-except:
-    import ndimage
+from scipy.testing import *
+import scipy.ndimage as ndimage
 
-restore_path()
-#import numarray.numinclude as numinclude
-
 eps = 1e-12
 
 def diff(a, b):
@@ -66,7 +57,7 @@
     return math.sqrt(t)
 
 
-class TestNdimage(NumpyTestCase):
+class TestNdimage(TestCase):
 
     def setUp(self):
         # list of numarray data types
@@ -5522,5 +5513,4 @@
 #    return len(result.failures), result.testsRun
 
 if __name__ == "__main__":
-    #unittest.main()
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/odr/__init__.py
===================================================================
--- trunk/scipy/odr/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/odr/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -21,6 +21,6 @@
 __all__ = ['odr', 'odr_error', 'odr_stop', 'Data', 'RealData', 'Model',
            'Output', 'ODR', 'odrpack']
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test
 #### EOF #######################################################################

Modified: trunk/scipy/odr/tests/test_odr.py
===================================================================
--- trunk/scipy/odr/tests/test_odr.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/odr/tests/test_odr.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,11 +4,11 @@
 # Scipy imports.
 import numpy as np
 from numpy import pi
-from numpy.testing import NumpyTest, NumpyTestCase, assert_array_almost_equal
+from scipy.testing import *
 from scipy.odr import Data, Model, ODR, RealData, odr_stop
 
 
-class TestODR(NumpyTestCase):
+class TestODR(TestCase):
 
     # Explicit Example
 
@@ -311,6 +311,5 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
-
+    unittest.main()
 #### EOF #######################################################################

Modified: trunk/scipy/optimize/__init__.py
===================================================================
--- trunk/scipy/optimize/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/optimize/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -16,5 +16,5 @@
 from slsqp import fmin_slsqp
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/optimize/tests/test_cobyla.py
===================================================================
--- trunk/scipy/optimize/tests/test_cobyla.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/optimize/tests/test_cobyla.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,13 +1,11 @@
+import math
 
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
-from optimize import cobyla as co
-restore_path()
-import math
+from scipy.optimize import cobyla as co
 
-class TestCobyla(NumpyTestCase):
-    def check_simple(self, level=1):
+class TestCobyla(TestCase):
+    def test_simple(self):
 
         function = lambda x: x[0]**2 + abs(x[1])**3
         con1 = lambda x: x[0]**2 + x[1]**2 - 25
@@ -20,4 +18,4 @@
         assert_almost_equal(x, [x0, x1], decimal=5)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/optimize/tests/test_nonlin.py
===================================================================
--- trunk/scipy/optimize/tests/test_nonlin.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/optimize/tests/test_nonlin.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,13 +3,12 @@
 May 2007
 """
 
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
 from scipy.optimize import nonlin
 from numpy import matrix, diag
-restore_path()
 
+
 def F(x):
     def p3(y):
         return float(y.T*y)*y
@@ -25,7 +24,7 @@
 
     return tuple(f.flat)
 
-class TestNonlin(NumpyTestCase):
+class TestNonlin(TestCase):
     """ Test case for a simple constrained entropy maximization problem
     (the machine translation example of Berger et al in
     Computational Linguistics, vol 22, num 1, pp 39--72, 1996.)
@@ -92,4 +91,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/optimize/tests/test_optimize.py
===================================================================
--- trunk/scipy/optimize/tests/test_optimize.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/optimize/tests/test_optimize.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,17 +3,16 @@
 Nov 2005
 """
 
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
 from scipy import optimize
 from numpy import array, zeros, float64, dot, log, exp, inf
 from scipy.optimize.tnc import RCSTRINGS, MSG_NONE
-restore_path()
 
+
 from math import sin, cos, pow
 
-class TestOptimize(NumpyTestCase):
+class TestOptimize(TestCase):
     """ Test case for a simple constrained entropy maximization problem
     (the machine translation example of Berger et al in
     Computational Linguistics, vol 22, num 1, pp 39--72, 1996.)
@@ -44,7 +43,7 @@
         return dot(self.F.transpose(), p) - self.K
 
 
-    def check_cg(self):
+    def test_cg(self):
         """ conjugate gradient optimization routine
         """
         retval = optimize.fmin_cg(self.func, self.startparams, self.grad, (), \
@@ -58,7 +57,7 @@
         assert err < 1e-6
 
 
-    def check_bfgs(self):
+    def test_bfgs(self):
         """ Broyden-Fletcher-Goldfarb-Shanno optimization routine
         """
         retval = optimize.fmin_bfgs(self.func, self.startparams, self.grad, \
@@ -72,7 +71,7 @@
         assert err < 1e-6
 
 
-    def check_powell(self):
+    def test_powell(self):
         """ Powell (direction set) optimization routine
         """
         retval = optimize.fmin_powell(self.func, self.startparams, \
@@ -85,7 +84,7 @@
         #print "Powell: Difference is: " + str(err)
         assert err < 1e-6
 
-    def check_neldermead(self):
+    def test_neldermead(self):
         """ Nelder-Mead simplex algorithm
         """
         retval = optimize.fmin(self.func, self.startparams, \
@@ -98,7 +97,7 @@
         #print "Nelder-Mead: Difference is: " + str(err)
         assert err < 1e-6
 
-    def check_ncg(self):
+    def test_ncg(self):
         """ line-search Newton conjugate gradient optimization routine
         """
         retval = optimize.fmin_ncg(self.func, self.startparams, self.grad,
@@ -113,7 +112,7 @@
         assert err < 1e-6
 
 
-    def check_l_bfgs_b(self):
+    def test_l_bfgs_b(self):
         """ limited-memory bound-constrained BFGS algorithm
         """
         retval = optimize.fmin_l_bfgs_b(self.func, self.startparams,
@@ -143,7 +142,7 @@
 
 
 
-class TestTnc(NumpyTestCase):
+class TestTnc(TestCase):
     """TNC non-linear optimization.
 
     These tests are taken from Prof. K. Schittkowski's test examples
@@ -244,4 +243,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/optimize/tests/test_slsqp.py
===================================================================
--- trunk/scipy/optimize/tests/test_slsqp.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/optimize/tests/test_slsqp.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,12 +1,11 @@
-from numpy.testing import *
+from scipy.testing import *
 import numpy as np
 
-set_package_path()
 from scipy.optimize import  fmin_slsqp
 from numpy import matrix, diag
-restore_path()
 
-class TestSLSQP(NumpyTestCase):
+
+class TestSLSQP(TestCase):
     """Test fmin_slsqp using Example 14.4 from Numerical Methods for
     Engineers by Steven Chapra and Raymond Canale.  This example
     maximizes the function f(x) = 2*x*y + 2*x - x**2 - 2*y**2, which
@@ -87,4 +86,4 @@
         assert_array_almost_equal(x,[2,1],decimal=3)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/optimize/tests/test_zeros.py
===================================================================
--- trunk/scipy/optimize/tests/test_zeros.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/optimize/tests/test_zeros.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,11 +1,10 @@
 #!/usr/bin/env python
 
 
-from numpy.testing import *
-set_package_path()
-from optimize import zeros as cc
-restore_path()
+from scipy.testing import *
 
+from scipy.optimize import zeros as cc
+
 from math import sin,sqrt,log
 from random import random
 
@@ -51,8 +50,8 @@
 functions = [f2,f3,f4,f5,f6]
 fstrings = ['f2','f3','f4','f5','f6']
 
-class TestBasic(NumpyTestCase) :
-    def run_test(self, method, name):
+class TestBasic(TestCase) :
+    def run_check(self, method, name):
         a = .5
         b = sqrt(3)
         for function, fname in zip(functions, fstrings):
@@ -61,16 +60,17 @@
             assert_almost_equal(zero, 1.0, decimal=12,
                 err_msg='method %s, function %s' % (name, fname))
 
-    def check_bisect(self):
-        self.run_test(cc.bisect, 'bisect')
-    def check_ridder(self):
-        self.run_test(cc.ridder, 'ridder')
-    def check_brentq(self):
-        self.run_test(cc.brentq, 'brentq')
-    def check_brenth(self):
-        self.run_test(cc.brenth, 'brenth')
+    def test_bisect(self):
+        self.run_check(cc.bisect, 'bisect')
+    def test_ridder(self):
+        self.run_check(cc.ridder, 'ridder')
+    def test_brentq(self):
+        self.run_check(cc.brentq, 'brentq')
+    def test_brenth(self):
+        self.run_check(cc.brenth, 'brenth')
 
-    def bench_run(self,level=5):
+    @dec.bench
+    def test_run(self):
         a = .5
         b = sqrt(3)
         repeat = 2000
@@ -85,7 +85,7 @@
             for j in range(len(methods)) :
                 meth = methods[j]
                 try:
-                    t = self.measure("meth(func,a,b)",repeat)
+                    t = measure("meth(func,a,b)",repeat)
                 except:
                     print '%s : failed'%mstrings[j]
                 else:
@@ -93,4 +93,4 @@
             print '\n\n'
 
 if __name__ == '__main__' :
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/arpack/tests/test_arpack.py
===================================================================
--- trunk/scipy/sandbox/arpack/tests/test_arpack.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/arpack/tests/test_arpack.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -9,17 +9,14 @@
 
 """
 
-import sys
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
-from arpack import *
-del sys.path[0]
+from scipy.sandbox.arpack import *
 
 import numpy
 from scipy.linalg import eig,eigh,norm
 
-class TestEigenNonsymmetric(NumpyTestCase):
+class TestEigenNonsymmetric(TestCase):
 
     def get_a1(self,typ):
         mat=numpy.array([[-2., -8.,  1.,  2., -5.],
@@ -106,7 +103,7 @@
         assert_array_almost_equal(num[:k],exact[:k],decimal=5)
 
 
-    def check_type(self):
+    def test_type(self):
         k=2
         for typ in 'fd':
             self.large_magnitude(typ,k)
@@ -121,7 +118,7 @@
 
 
 
-class TestEigenComplexNonsymmetric(NumpyTestCase):
+class TestEigenComplexNonsymmetric(TestCase):
 
     def get_a1(self,typ):
         mat=numpy.array([[-2., -8.,  1.,  2., -5.],
@@ -205,7 +202,7 @@
         assert_array_almost_equal(num,exact[:k],decimal=5)
 
 
-    def check_type(self):
+    def test_type(self):
         k=2
         for typ in 'FD':
             self.large_magnitude(typ,k)
@@ -218,7 +215,7 @@
 
 
 
-class TestEigenSymmetric(NumpyTestCase):
+class TestEigenSymmetric(TestCase):
 
     def get_a1(self,typ):
         mat_a1=numpy.array([[ 2.,  0.,  0., -1.,  0., -1.],
@@ -275,14 +272,14 @@
         for i in range(k):
             assert_array_almost_equal(sb.dot(a,v[:,i]),w[i]*v[:,i])
 
-    def check_eigenvectors(self):
+    def test_eigenvectors(self):
         k=2
         for typ in 'fd':
             self.large_eigenvectors(typ,k)
             self.small_eigenvectors(typ,k)
             self.end_eigenvectors(typ,k)
 
-    def check_type(self):
+    def test_type(self):
         k=2
         for typ in 'fd':
             self.large_eigenvalues(typ,k)
@@ -290,7 +287,7 @@
             self.end_eigenvalues(typ,k)
 
 
-class TestEigenComplexSymmetric(NumpyTestCase):
+class TestEigenComplexSymmetric(TestCase):
 
     def get_a1(self,typ):
         mat_a1=numpy.array([[ 2.,  0.,  0., -1.,  0., -1.],
@@ -341,7 +338,7 @@
         w.real.sort()
         assert_array_almost_equal(w,aw[:k])
 
-    def check_complex_symmetric(self):
+    def test_complex_symmetric(self):
         k=2
         for typ in 'FD':
             self.large_magnitude(typ,k)
@@ -352,4 +349,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/arpack/tests/test_speigs.py
===================================================================
--- trunk/scipy/sandbox/arpack/tests/test_speigs.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/arpack/tests/test_speigs.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,14 +1,12 @@
 #!/usr/bin/env python
 
-import sys
-from numpy.testing import *
-set_package_path()
-from arpack.speigs import *
-restore_path()
+from scipy.testing import *
 
+from scipy.sandbox.arpack.speigs import *
+
 import numpy as N
 
-class TestEigs(NumpyTestCase):
+class TestEigs(TestCase):
     def test(self):
         maxn=15                # Dimension of square matrix to be solved
         # Use a PDP^-1 factorisation to construct matrix with known
@@ -30,13 +28,13 @@
         nev=4
         eigvs = ARPACK_eigs(matvec, A.shape[0], nev=nev)
         calc_vals = eigvs[0]
-        # Ensure the calculate eigenvectors have the same sign as the refence values
+        # Ensure the calculated eigenvectors have the same sign as the reference values
         calc_vecs = eigvs[1] / [N.sign(x[0]) for x in eigvs[1].T]
         assert_array_almost_equal(calc_vals, vals[0:nev], decimal=7)
         assert_array_almost_equal(calc_vecs,  N.array(vecs)[:,0:nev], decimal=7)
 
 
-# class TestGeneigs(NumpyTestCase):
+# class TestGeneigs(TestCase):
 #     def test(self):
 #         import pickle
 #         import scipy.linsolve
@@ -50,4 +48,4 @@
 #          94.646308846854879, 95.30841709116271], decimal=11)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/buildgrid/test_build_grid.py
===================================================================
--- trunk/scipy/sandbox/buildgrid/test_build_grid.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/buildgrid/test_build_grid.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -5,6 +5,8 @@
 """
 
 import sys,math,random,time
+from scipy.sandbox import buildgrid
+
 random.seed(7)
 
 global ncol,nrow,step,xmin,ymin,simple
@@ -84,11 +86,10 @@
 xp,yp,zp = makeInputXYZ(xyzfile, datapoints)
 
 
-import BuildGrid
 
 # get file statistics
 nvals,xmin,xmax,ymin,ymax,zmin,zmax,zavrg,zstnd = \
-    BuildGrid.filestatistics(xyzfile)
+    buildgrid.filestatistics(xyzfile)
 print xyzfile,'statistics.  Number of values',nvals
 print 'X min %9.1f   max %9.1f' % (xmin,xmax)
 print 'Y min %9.1f   max %9.1f' % (ymin,ymax)
@@ -97,7 +98,7 @@
 
 # build grid 'fromfile'
 t0 = time.clock()
-grid = BuildGrid.fromfile(xyzfile=xyzfile,
+grid = buildgrid.fromfile(xyzfile=xyzfile,
     nx=ncol, ny=nrow, step=step, xmin=xmin, ymin=ymin, 
     method='Good',      # or 'Best' - not implemented
     trimming=trimdist,  # if no trimming - full grid
@@ -112,14 +113,14 @@
 if not build_only:
     outfile = "outdata1.xyz"
     t0 = time.clock()
-    rv = BuildGrid.tofile(filename=outfile, griddata=grid, gridtype='xyz',
+    rv = buildgrid.tofile(filename=outfile, griddata=grid, gridtype='xyz',
         nx=ncol, ny=nrow, step=step, xmin=xmin, ymin=ymin, unvalue=1234.4321)
     print 'tofile():',outfile,rv,"(%.2f sec)" % (time.clock()-t0)
 
 
 # build grid from xyz lists
 t0 = time.clock()
-grid2 = BuildGrid.fromxyz(xdata=xp,ydata=yp,zdata=zp,
+grid2 = buildgrid.fromxyz(xdata=xp,ydata=yp,zdata=zp,
     nx=ncol, ny=nrow, step=step, xmin=xmin, ymin=ymin, 
     method='Good',      # or 'Best' (not implemented)
     trimming=trimdist,  # if no trimming - full grid
@@ -133,7 +134,7 @@
 if not build_only:
     outfile = "outdata2.xyz"
     t0 = time.clock()
-    rv = BuildGrid.tofile(filename=outfile, griddata=grid2, gridtype='xyz',
+    rv = buildgrid.tofile(filename=outfile, griddata=grid2, gridtype='xyz',
         nx=ncol, ny=nrow, step=step, xmin=xmin, ymin=ymin, unvalue=1234.4321)
     print 'tofile():',outfile,rv,"(%.2f sec)" % (time.clock()-t0)
 

Modified: trunk/scipy/sandbox/cdavid/__init__.py
===================================================================
--- trunk/scipy/sandbox/cdavid/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/cdavid/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -5,5 +5,5 @@
 from autocorr import autocorr_oneside_nofft, autocorr_fft
 from segmentaxis import segment_axis
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/sandbox/cdavid/segmentaxis.py
===================================================================
--- trunk/scipy/sandbox/cdavid/segmentaxis.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/cdavid/segmentaxis.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,6 +1,6 @@
 import numpy as N
-import unittest
-from numpy.testing import NumpyTestCase, assert_array_almost_equal,             assert_almost_equal, assert_equal
+from numpy.testing import assert_array_almost_equal, \
+     assert_almost_equal, assert_equal
 import warnings
 
 def segment_axis(a, length, overlap=0, axis=None, end='cut', endvalue=0):

Modified: trunk/scipy/sandbox/constants/constants.py
===================================================================
--- trunk/scipy/sandbox/constants/constants.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/constants/constants.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -12,7 +12,7 @@
 physical constants: imported from CODATA
 unit conversion: see e.g. NIST special publication 811
 Use at own risk: double-check values before calculating your Mars orbit-insertion burn.
-Some constants exist in a few variants, which are marked with sufixes.
+Some constants exist in a few variants, which are marked with suffixes.
 The ones without any suffix should be the most common one.
 """
 

Modified: trunk/scipy/sandbox/delaunay/tests/test_triangulate.py
===================================================================
--- trunk/scipy/sandbox/delaunay/tests/test_triangulate.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/delaunay/tests/test_triangulate.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,6 +1,7 @@
 from scipy.sandbox import delaunay as dlny
 from numpy import random
 import scipy as sp
+from scipy.testing import *
 
 def onright(x0, y0, x1, y1, x, y):
     """Return True if (x,y) is to the right of the vector from (x0,y0) to
@@ -16,12 +17,11 @@
     assert r2 < r
 
 
-class TestSanity(object):
-    def setup_method(self, method):
+class TestSanity(TestCase):
+    def setUp(self):
         self.rs = random.RandomState(1234567890)
 
     def test_counts(self):
-        assert False
         for n in (10, 30, 100, 300, 1000, 3000):
             x, y = self.rs.uniform(0, 100, size=(2, n))
             tri = dlny.Triangulation(x, y)
@@ -35,7 +35,6 @@
             assert sp.sum((tri.triangle_neighbors == -1).astype(sp.int32).flat) == k
 
     def test_ccw_triangles(self):
-        assert False
         for n in (10, 30, 100, 300, 1000, 3000):
             x, y = self.rs.uniform(0, 100, size=(2, n))
             tri = dlny.Triangulation(x, y)
@@ -44,7 +43,6 @@
                 assert not onright(x[i], y[i], x[j], y[j], x[k], y[k])
 
     def test_ccw_hull(self):
-        assert False
         for n in (10, 30, 100, 300, 1000, 3000):
             x, y = self.rs.uniform(0, 100, size=(2, n))
             tri = dlny.Triangulation(x, y)
@@ -57,7 +55,6 @@
                 assert not onright(x[i], y[i], x[j], y[j], x[k], y[k])
 
     def test_circle_condition(self):
-        assert False
         for n in (10, 30, 100, 300, 1000, 3000):
             x, y = self.rs.uniform(0, 100, size=(2, n))
             tri = dlny.Triangulation(x, y)
@@ -68,3 +65,8 @@
             alldist2 = (sp.subtract.outer(x, tri.circumcenters[:,0])**2
                       + sp.subtract.outer(y, tri.circumcenters[:,1])**2)
             assert sp.alltrue(r2 <= alldist2)
+
+
+if __name__ == '__main__':
+    unittest.main()
+    

Deleted: trunk/scipy/sandbox/dhuard/test_histogram.py
===================================================================
--- trunk/scipy/sandbox/dhuard/test_histogram.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/dhuard/test_histogram.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,99 +0,0 @@
-from numpy.testing import *
-from histogram import _histogram_fixed_binsize, _histogram_digitize,\
-    _histogram_searchsort, histogram,_optimize_binning
-import numpy as np
-from numpy.random import rand
-
-class TestHistogram1DFunctions(NumpyTestCase):
-    def check_consistency(self):
-        n = 100
-        r = rand(n)*12-1
-        bins = range(11)
-        a = _histogram_fixed_binsize(r, bins[0], bins[1]-bins[0], len(bins)-1)
-        b = _histogram_digitize(r, None, np.array(bins), False)
-        c = _histogram_searchsort(r,bins)
-        assert_array_equal(a,b)
-        assert_array_equal(c,b)
-
-class TestHistogram(NumpyTestCase):
-    def check_simple(self):
-        n=100
-        v=rand(n)
-        (a,b)=histogram(v)
-        #check if the sum of the bins equals the number of samples
-        assert_equal(np.sum(a,axis=0),n)
-        #check that the bin counts are evenly spaced when the data is from a linear function
-        (a,b)=histogram(np.linspace(0,10,100))
-        assert_array_equal(a,10)
-        #Check the construction of the bin array
-        a, b = histogram(v, bins=4, range=[.2,.8])
-        assert_array_almost_equal(b['edges'],np.linspace(.2, .8, 5),8)
-        #Check the number of outliers
-        assert_equal((v<.2).sum(), b['lower'])
-        assert_equal((v>.8).sum(),b['upper'])
-        #Check the normalization
-        bins = [0,.5,.75,1]
-        a,b = histogram(v, bins, normed=True)
-        assert_almost_equal((a*np.diff(bins)).sum(), 1)
-
-    def check_axis(self):
-        n,m = 100,20
-        v = rand(n,m)
-        a,b = histogram(v, bins=5)
-        # Check dimension is reduced (axis=None).
-        assert_equal(a.ndim, 1)
-        #Check total number of count is equal to the number of samples.
-        assert_equal(a.sum(), n*m)
-        a,b = histogram(v, bins = 7, axis=0)
-        # Check shape of new array is ok.
-        assert(a.ndim == 2)
-        assert_array_equal(a.shape,[7, m])
-        # Check normalization is consistent
-        a,b = histogram(v, bins = 7, axis=0, normed=True)
-        assert_array_almost_equal((a.T*np.diff(b['edges'])).sum(1), np.ones((m)),5)
-        a,b = histogram(v, bins = 7, axis=1, normed=True)
-        assert_array_equal(a.shape, [n,7])
-        assert_array_almost_equal((a*np.diff(b['edges'])).sum(1), np.ones((n)))
-        # Check results are consistent with 1d estimate
-        a1, b1 = histogram(v[0,:], bins=b['edges'], normed=True)
-        assert_array_almost_equal(a1, a[0,:],7)
-
-    def check_weights(self):
-        # Check weights = constant gives the same answer as no weights.
-        v = rand(100)
-        w = np.ones(100)*5
-        a,b = histogram(v)
-        na,nb = histogram(v, normed=True)
-        wa,wb = histogram(v, weights=w)
-        nwa,nwb = histogram(v, weights=w, normed=True)
-        assert_array_equal(a*5, wa)
-        assert_array_almost_equal(na, nwa,8)
-        # Check weights are properly applied.
-        v = np.linspace(0,10,10)
-        w = np.concatenate((np.zeros(5), np.ones(5)))
-        wa,wb = histogram(v, bins=np.linspace(0,10.01, 11),weights=w)
-        assert_array_almost_equal(wa, w)
-
-    def check_strategies(self):
-        v = rand(100)
-        ae,be = histogram(v, strategy='binsize')
-        ab,bb = histogram(v, strategy='digitize')
-        as,bs = histogram(v, strategy='searchsort')
-        assert_array_equal(ae, ab)
-        assert_array_equal(ae, as)
-
-        w = rand(100)
-        ae,be = histogram(v, weights=w, strategy='binsize')
-        ab,bb = histogram(v, weights=w, strategy='digitize')
-        as,bs = histogram(v, weights=w, strategy='searchsort')
-        assert_array_almost_equal(ae, ab,8)
-        assert_array_almost_equal(ae, as,8)
-
-    def check_automatic_binning(self):
-        v = rand(100)
-        h,b = histogram(v, 'Scott')
-        h,b = histogram(v, 'Freedman')
-
-
-if __name__ == "__main__":
-    NumpyTest().run()

Deleted: trunk/scipy/sandbox/dhuard/test_stats.py
===================================================================
--- trunk/scipy/sandbox/dhuard/test_stats.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/dhuard/test_stats.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,45 +0,0 @@
-"""
-Test statistical functions.
-"""
-
-
-from numpy.testing import *
-import stats
-import numpy as np
-
-N = 100
-np.random.seed(2)
-r = np.random.randn(N)
-
-class TestEmpiricalCDF(NumpyTestCase):
-    def check_hazen(self):
-
-        f = stats.empiricalcdf(r)
-        assert_equal(len(f), len(r))
-        assert_array_equal(np.argsort(r), np.argsort(f))
-        assert_array_equal(np.sort(f), (np.arange(N)+.5)/N)
-
-    def check_weibull(self):
-        f = stats.empiricalcdf(r, 'weibull')
-        assert_array_equal(np.sort(f), (np.arange(N)+1.)/(N+1.))
-
-    def check_california(self):
-        f = stats.empiricalcdf(r, 'california')
-        assert_array_equal(np.sort(f), (np.arange(N))/float(N))
-
-class TestScoreAtPercentile(NumpyTestCase):
-    def check_simple(self):
-        r = np.random.randn(1000)
-        s = stats.scoreatpercentile(r, [15.9,50,84.1])
-        assert_array_almost_equal(s, [-1,0,1], 1)
-
-class TestPercentileOfScore(NumpyTestCase):
-    def check_simple(self):
-        r = np.random.randn(3000)
-        p = stats.percentileofscore(r, [-1,0,1])
-        assert_array_almost_equal(p, [15.9, 50, 84.1], 0)
-
-
-
-if __name__ == '__main__':
-    NumpyTest().run()

Added: trunk/scipy/sandbox/dhuard/tests/test_histogram.py
===================================================================
--- trunk/scipy/sandbox/dhuard/tests/test_histogram.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/dhuard/tests/test_histogram.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -0,0 +1,99 @@
+from scipy.testing import *
+from scipy.sandbox.dhuard.histogram import _histogram_fixed_binsize, _histogram_digitize,\
+    _histogram_searchsort, histogram,_optimize_binning
+import numpy as np
+from numpy.random import rand
+
+class TestHistogram1DFunctions(TestCase):
+    def test_consistency(self):
+        n = 100
+        r = rand(n)*12-1
+        bins = range(11)
+        a = _histogram_fixed_binsize(r, bins[0], bins[1]-bins[0], len(bins)-1)
+        b = _histogram_digitize(r, None, np.array(bins), False)
+        c = _histogram_searchsort(r,bins)
+        assert_array_equal(a,b)
+        assert_array_equal(c,b)
+
+class TestHistogram(TestCase):
+    def test_simple(self):
+        n=100
+        v=rand(n)
+        (a,b)=histogram(v)
+        #check if the sum of the bins equals the number of samples
+        assert_equal(np.sum(a,axis=0),n)
+        #check that the bin counts are evenly spaced when the data is from a linear function
+        (a,b)=histogram(np.linspace(0,10,100))
+        assert_array_equal(a,10)
+        #Check the construction of the bin array
+        a, b = histogram(v, bins=4, range=[.2,.8])
+        assert_array_almost_equal(b['edges'],np.linspace(.2, .8, 5),8)
+        #Check the number of outliers
+        assert_equal((v<.2).sum(), b['lower'])
+        assert_equal((v>.8).sum(),b['upper'])
+        #Check the normalization
+        bins = [0,.5,.75,1]
+        a,b = histogram(v, bins, normed=True)
+        assert_almost_equal((a*np.diff(bins)).sum(), 1)
+
+    def test_axis(self):
+        n,m = 100,20
+        v = rand(n,m)
+        a,b = histogram(v, bins=5)
+        # Check dimension is reduced (axis=None).
+        assert_equal(a.ndim, 1)
+        #Check total number of count is equal to the number of samples.
+        assert_equal(a.sum(), n*m)
+        a,b = histogram(v, bins = 7, axis=0)
+        # Check shape of new array is ok.
+        assert(a.ndim == 2)
+        assert_array_equal(a.shape,[7, m])
+        # Check normalization is consistent
+        a,b = histogram(v, bins = 7, axis=0, normed=True)
+        assert_array_almost_equal((a.T*np.diff(b['edges'])).sum(1), np.ones((m)),5)
+        a,b = histogram(v, bins = 7, axis=1, normed=True)
+        assert_array_equal(a.shape, [n,7])
+        assert_array_almost_equal((a*np.diff(b['edges'])).sum(1), np.ones((n)))
+        # Check results are consistent with 1d estimate
+        a1, b1 = histogram(v[0,:], bins=b['edges'], normed=True)
+        assert_array_almost_equal(a1, a[0,:],7)
+
+    def test_weights(self):
+        # Check weights = constant gives the same answer as no weights.
+        v = rand(100)
+        w = np.ones(100)*5
+        a,b = histogram(v)
+        na,nb = histogram(v, normed=True)
+        wa,wb = histogram(v, weights=w)
+        nwa,nwb = histogram(v, weights=w, normed=True)
+        assert_array_equal(a*5, wa)
+        assert_array_almost_equal(na, nwa,8)
+        # Check weights are properly applied.
+        v = np.linspace(0,10,10)
+        w = np.concatenate((np.zeros(5), np.ones(5)))
+        wa,wb = histogram(v, bins=np.linspace(0,10.01, 11),weights=w)
+        assert_array_almost_equal(wa, w)
+
+    def test_strategies(self):
+        v = rand(100)
+        ae,be = histogram(v, strategy='binsize')
+        ab,bb = histogram(v, strategy='digitize')
+        as,bs = histogram(v, strategy='searchsort')
+        assert_array_equal(ae, ab)
+        assert_array_equal(ae, as)
+
+        w = rand(100)
+        ae,be = histogram(v, weights=w, strategy='binsize')
+        ab,bb = histogram(v, weights=w, strategy='digitize')
+        as,bs = histogram(v, weights=w, strategy='searchsort')
+        assert_array_almost_equal(ae, ab,8)
+        assert_array_almost_equal(ae, as,8)
+
+    def test_automatic_binning(self):
+        v = rand(100)
+        h,b = histogram(v, 'Scott')
+        h,b = histogram(v, 'Freedman')
+
+
+if __name__ == "__main__":
+    unittest.main()

Added: trunk/scipy/sandbox/dhuard/tests/test_stats.py
===================================================================
--- trunk/scipy/sandbox/dhuard/tests/test_stats.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/dhuard/tests/test_stats.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -0,0 +1,44 @@
+"""
+Test statistical functions.
+"""
+
+from scipy.testing import *
+from scipy.sandbox.dhuard import stats
+import numpy as np
+
+N = 100
+np.random.seed(2)
+r = np.random.randn(N)
+
+class TestEmpiricalCDF(TestCase):
+    def test_hazen(self):
+
+        f = stats.empiricalcdf(r)
+        assert_equal(len(f), len(r))
+        assert_array_equal(np.argsort(r), np.argsort(f))
+        assert_array_equal(np.sort(f), (np.arange(N)+.5)/N)
+
+    def test_weibull(self):
+        f = stats.empiricalcdf(r, 'weibull')
+        assert_array_equal(np.sort(f), (np.arange(N)+1.)/(N+1.))
+
+    def test_california(self):
+        f = stats.empiricalcdf(r, 'california')
+        assert_array_equal(np.sort(f), (np.arange(N))/float(N))
+
+class TestScoreAtPercentile(TestCase):
+    def test_simple(self):
+        r = np.random.randn(1000)
+        s = stats.scoreatpercentile(r, [15.9,50,84.1])
+        assert_array_almost_equal(s, [-1,0,1], 1)
+
+class TestPercentileOfScore(TestCase):
+    def test_simple(self):
+        r = np.random.randn(3000)
+        p = stats.percentileofscore(r, [-1,0,1])
+        assert_array_almost_equal(p, [15.9, 50, 84.1], 0)
+
+
+
+if __name__ == '__main__':
+    unittest.main()

Modified: trunk/scipy/sandbox/fdfpack/tests/test_fdf.py
===================================================================
--- trunk/scipy/sandbox/fdfpack/tests/test_fdf.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/fdfpack/tests/test_fdf.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,33 +1,32 @@
 
+from scipy.testing import *
 
-from numpy.testing import *
-set_package_path()
-from fdfpack import periodic_finite_difference as diff
-restore_path()
+from scipy.sandbox.fdfpack import periodic_finite_difference as diff
 
+
 from numpy import arange, add, array,sin,cos,pi
 
-class TestDiff(NumpyTestCase):
-    def check_1(self):
+class TestDiff(TestCase):
+    def test_1(self):
         for n in [64,100,125,4000]:
             x = arange(n)*2*pi/n
             for m in range(5,15):
                 assert_array_almost_equal(diff(sin(x),m=m),cos(x))
-    def check_2(self):
+    def test_2(self):
         for n in [64,100,125,4000]:
             x = arange(n)*2*pi/n
             for m in range(8,15)+[6]:
                 assert_array_almost_equal(diff(sin(x),k=2,m=m),-sin(x))
-    def check_3(self):
+    def test_3(self):
         for n in [64,100,125,4000]:
             x = arange(n)*2*pi/n
             for m in range(7,15):
                 assert_array_almost_equal(diff(sin(x),k=3,m=m)/n,-cos(x)/n)
-    def check_4(self):
+    def test_4(self):
         for n in [64,100,125,200,2000]:
             x = arange(n)*2*pi/n
             for m in range(10,15):
                 assert_array_almost_equal(diff(sin(x),k=4,m=m)/n,sin(x)/n)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/lobpcg/__init__.py
===================================================================
--- trunk/scipy/sandbox/lobpcg/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/lobpcg/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -7,5 +7,5 @@
 
 from lobpcg import *
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/sandbox/lobpcg/tests/large_scale.py
===================================================================
--- trunk/scipy/sandbox/lobpcg/tests/large_scale.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/lobpcg/tests/large_scale.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,4 +1,5 @@
-from scipy import *
+from scipy import array, arange, ones, sort, cos, pi, rand, \
+     set_printoptions, r_
 from scipy.sandbox import lobpcg
 from scipy.sparse import spdiags, speye
 from pylab import loglog, show, xlabel, ylabel, title

Modified: trunk/scipy/sandbox/lobpcg/tests/test_lobpcg.py
===================================================================
--- trunk/scipy/sandbox/lobpcg/tests/test_lobpcg.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/lobpcg/tests/test_lobpcg.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,10 +1,11 @@
-from scipy import *
+from scipy import array, arange, ones, sort, cos, pi, rand, \
+     set_printoptions, r_, diag, linalg
 from scipy.sandbox import lobpcg
 from symeig import symeig
 from pylab import plot, show, legend, xlabel, ylabel
 set_printoptions(precision=3,linewidth=90)
 
-def test1(n):
+def check1(n):
     L = 1.0
     le=L/n
     rho = 7.85e3
@@ -16,7 +17,7 @@
     B = mass*(diag(r_[4.*ones(n-1),2])+diag(ones(n-1),1)+diag(ones(n-1),-1))
     return A,B
 
-def test2(n):
+def check2(n):
     x = arange(1,n+1)
     B = diag(1./x)
     y = arange(n-1,0,-1)
@@ -26,22 +27,22 @@
 
 n = 100 # Dimension
 
-A,B = test1(n) # Fixed-free elastic rod
-A,B = test2(n) # Mikota pair acts as a nice test since the eigenvalues are the squares of the integers n, n=1,2,...
+def test_1and2():
+    A,B = check1(n) # Fixed-free elastic rod
+    A,B = check2(n) # Mikota pair acts as a nice test since the eigenvalues are the squares of the integers n, n=1,2,...
+    
+    m = 20
+    V = rand(n,m)
+    X = linalg.orth(V)
+    
+    eigs,vecs = lobpcg.lobpcg(X,A,B)
+    eigs = sort(eigs)
+    
+    w,v=symeig(A,B)
 
-m = 20
-V = rand(n,m)
-X = linalg.orth(V)
-
-eigs,vecs = lobpcg.lobpcg(X,A,B)
-eigs = sort(eigs)
-
-w,v=symeig(A,B)
-
-
-plot(arange(0,len(w[:m])),w[:m],'bx',label='Results by symeig')
-plot(arange(0,len(eigs)),eigs,'r+',label='Results by lobpcg')
-legend()
-xlabel(r'Eigenvalue $i$')
-ylabel(r'$\lambda_i$')
-show()
+    plot(arange(0,len(w[:m])),w[:m],'bx',label='Results by symeig')
+    plot(arange(0,len(eigs)),eigs,'r+',label='Results by lobpcg')
+    legend()
+    xlabel(r'Eigenvalue $i$')
+    ylabel(r'$\lambda_i$')
+    show()

Modified: trunk/scipy/sandbox/maskedarray/alternative_versions/test_mrecarray.py
===================================================================
--- trunk/scipy/sandbox/maskedarray/alternative_versions/test_mrecarray.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/maskedarray/alternative_versions/test_mrecarray.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -14,22 +14,18 @@
 
 import numpy as N
 import numpy.core.fromnumeric  as fromnumeric
-from numpy.testing import NumpyTest, NumpyTestCase
-from numpy.testing.utils import build_err_msg
+from scipy.testing import *
+from scipy.sandbox.maskedarray.testutils import *
 
-import maskedarray.testutils
-from maskedarray.testutils import *
+import scipy.sandbox.maskedarray.core as MA
+from scipy.sandbox.maskedarray.mrecords import mrecarray, fromarrays, fromtextfile, fromrecords
 
-import maskedarray.core as MA
-import maskedarray.mrecords
-from maskedarray.mrecords import mrecarray, fromarrays, fromtextfile, fromrecords
 
-
 #..............................................................................
-class TestMrecarray(NumpyTestCase):
+class TestMrecarray(TestCase):
     "Base test class for MaskedArrays."
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         self.setup()
 
     def setup(self):
@@ -125,4 +121,4 @@
 ###############################################################################
 #------------------------------------------------------------------------------
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/maskedarray/testutils.py
===================================================================
--- trunk/scipy/sandbox/maskedarray/testutils.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/maskedarray/testutils.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -14,7 +14,6 @@
 from numpy.core import ndarray
 from numpy.core.numerictypes import float_
 import numpy.core.umath as umath
-from numpy.testing import NumpyTest, NumpyTestCase
 from numpy.testing.utils import build_err_msg, rand
 
 import core

Modified: trunk/scipy/sandbox/montecarlo/tests/test_dictsampler.py
===================================================================
--- trunk/scipy/sandbox/montecarlo/tests/test_dictsampler.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/montecarlo/tests/test_dictsampler.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -10,19 +10,16 @@
 from numpy import arange, add, array, dot, zeros, identity
 
 import sys
-from numpy.testing import *
-set_package_path()
-from numpy import *
+from scipy.testing import *
+
+from numpy import sum, array, average, sqrt
 #from scipy.montecarlo import *
 from scipy.sandbox.montecarlo import *
 from scipy import stats
-restore_path()
 
-import unittest
 
-
-class test_dict_sampler(NumpyTestCase):
-    def check_simple(self):
+class test_dict_sampler(TestCase):
+    def test_simple(self):
         """
         # Sample from this discrete distribution:
         #    x       'a'       'b'       'c'
@@ -51,7 +48,7 @@
         #z = 2.5758   # = norminv(0.995), for a 1% confidence interval
         #assert abs(m - lam) < z * lam/sqrt(numsamples)
 
-    def check_sanity(self):
+    def test_sanity(self):
         # Sample from this pmf:
         #      x        0       1       2       3       4
         #      p(x)     0.5     0.1     0.15    0       0.25
@@ -76,4 +73,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/montecarlo/tests/test_intsampler.py
===================================================================
--- trunk/scipy/sandbox/montecarlo/tests/test_intsampler.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/montecarlo/tests/test_intsampler.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -18,16 +18,14 @@
 from numpy import arange, add, array, dot, zeros, identity
 
 import sys
-from numpy.testing import *
-set_package_path()
-from numpy import *
+from scipy.testing import *
+
 from scipy.sandbox.montecarlo import *
 from scipy import stats
-restore_path()
 
 
-class test_int_sampler(NumpyTestCase):
-    def check_simple(self):
+class test_int_sampler(TestCase):
+    def test_simple(self):
         # Sample from a Poisson distribution, P(lambda = 10.0)
         lam = 10.0
         n = 35
@@ -41,7 +39,7 @@
         z = 2.5758   # = norminv(0.995), for a 1% confidence interval
         assert abs(m - lam) < z * lam/sqrt(numsamples)
 
-    def check_sanity(self):
+    def test_sanity(self):
         # Sample from this pmf:
         #      x        0       1       2       3       4
         #      p(x)     0.5     0.1     0.15    0       0.25
@@ -67,4 +65,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/multigrid/__init__.py
===================================================================
--- trunk/scipy/sandbox/multigrid/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/multigrid/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -5,5 +5,5 @@
 from multilevel import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/sandbox/multigrid/simple_test.py
===================================================================
--- trunk/scipy/sandbox/multigrid/simple_test.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/multigrid/simple_test.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,4 +1,4 @@
-from scipy import *
+from scipy import rand
 from scipy.sandbox.multigrid.sa import *
 from scipy.sandbox.multigrid import *
 from scipy.sandbox.multigrid.utils import *

Modified: trunk/scipy/sandbox/multigrid/tests/test_adaptive.py
===================================================================
--- trunk/scipy/sandbox/multigrid/tests/test_adaptive.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/multigrid/tests/test_adaptive.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,20 +1,20 @@
-from numpy.testing import *
+from scipy.testing import *
 
 from scipy.sparse import csr_matrix
 from numpy import arange,ones,zeros,array,eye,vstack,diff
 
-set_package_path()
+
 from scipy.sandbox.multigrid.sa import sa_fit_candidates
 from scipy.sandbox.multigrid.adaptive import augment_candidates
-restore_path()
 
+
 #import pdb; pdb.set_trace()
 
-class TestAdaptiveSA(NumpyTestCase):
+class TestAdaptiveSA(TestCase):
     def setUp(self):
         pass
 
-class TestAugmentCandidates(NumpyTestCase):
+class TestAugmentCandidates(TestCase):
     def setUp(self):
         self.cases = []
 
@@ -25,7 +25,7 @@
 
 
 
-    def check_first_level(self):
+    def test_first_level(self):
         cases = []
 
         ## tests where AggOp includes all DOFs
@@ -66,4 +66,4 @@
 
 
 if __name__ == '__main__':
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/multigrid/tests/test_relaxation.py
===================================================================
--- trunk/scipy/sandbox/multigrid/tests/test_relaxation.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/multigrid/tests/test_relaxation.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,4 +1,4 @@
-from numpy.testing import *
+from scipy.testing import *
 
 import numpy
 import scipy
@@ -6,14 +6,14 @@
 from scipy.sparse import spdiags
 
 
-set_package_path()
+
 import scipy.sandbox.multigrid
 from scipy.sandbox.multigrid.relaxation import polynomial_smoother,gauss_seidel,jacobi
-restore_path()
 
 
-class TestRelaxation(NumpyTestCase):
-    def check_polynomial(self):
+
+class TestRelaxation(TestCase):
+    def test_polynomial(self):
         N  = 3
         A  = spdiags([2*ones(N),-ones(N),-ones(N)],[0,-1,1],N,N,format='csr')
         x0 = arange(N).astype(numpy.float64)
@@ -37,7 +37,7 @@
         polynomial_smoother(A,x,b,[-0.14285714,  1., -2.])
         assert_almost_equal(x,x0 - 0.14285714*A*A*r + A*r - 2*r)
 
-    def check_jacobi(self):
+    def test_jacobi(self):
         N = 1
         A = spdiags([2*ones(N),-ones(N),-ones(N)],[0,-1,1],N,N,format='csr')
         x = arange(N).astype(numpy.float64)
@@ -81,7 +81,7 @@
         jacobi(A,x,b,omega=1.0/3.0)
         assert_almost_equal(x,2.0/3.0*x_copy + 1.0/3.0*array([5.5,11.0,15.5]))
 
-    def check_gauss_seidel_bsr(self):
+    def test_gauss_seidel_bsr(self):
         cases = []
 
         for N in [1,2,3,4,5,6,10]:
@@ -100,7 +100,7 @@
                 assert_almost_equal(x_bsr,x_csr)
                
 
-    def check_gauss_seidel_csr(self):
+    def test_gauss_seidel_csr(self):
         N = 1
         A = spdiags([2*ones(N),-ones(N),-ones(N)],[0,-1,1],N,N,format='csr')
         x = arange(N).astype(numpy.float64)
@@ -158,4 +158,4 @@
         self.assert_(allclose(resid1,resid2))
 
 if __name__ == '__main__':
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/multigrid/tests/test_sa.py
===================================================================
--- trunk/scipy/sandbox/multigrid/tests/test_sa.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/multigrid/tests/test_sa.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,7 +4,7 @@
 except:
     pass
 
-from numpy.testing import *
+from scipy.testing import *
 from numpy import sqrt,empty,ones,arange,array_split,eye,array, \
                   zeros,diag,zeros_like,diff,matrix,hstack,vstack
 from numpy.linalg import norm
@@ -14,7 +14,7 @@
                          isspmatrix_lil
 import numpy
 
-set_package_path()
+
 import scipy.sandbox.multigrid
 from scipy.sandbox.multigrid.sa import sa_strong_connections, sa_constant_interpolation, \
                                         sa_interpolation, sa_fit_candidates, \
@@ -22,9 +22,9 @@
 from scipy.sandbox.multigrid.multilevel import poisson_problem1D,poisson_problem2D, \
                                         smoothed_aggregation_solver
 from scipy.sandbox.multigrid.utils import diag_sparse
-restore_path()
 
 
+
 #def sparsity(A):
 #    A = A.copy()
 #
@@ -38,7 +38,7 @@
 #
 #    return A
 
-class TestSA(NumpyTestCase):
+class TestSA(TestCase):
     def setUp(self):
         self.cases = []
 
@@ -54,7 +54,7 @@
             self.cases.append( poisson_problem2D(N) )
 
 
-    def check_sa_strong_connections(self):
+    def test_sa_strong_connections(self):
         for A in self.cases:
             for epsilon in [0.0,0.1,0.5,1.0,10.0]:
                 S_expected = reference_sa_strong_connections(A,epsilon)
@@ -62,7 +62,7 @@
                 assert_almost_equal(S_result.todense(),S_expected.todense())
                 #assert_array_equal(sparsity(S_result).todense(),sparsity(S_expected).todense())
 
-    def check_sa_constant_interpolation(self):
+    def test_sa_constant_interpolation(self):
         for A in self.cases:
             for epsilon in [0.0,0.1,0.5,1.0]:
                 S_expected = reference_sa_constant_interpolation(A,epsilon)
@@ -101,7 +101,7 @@
         assert_array_equal(S_result.todense(),S_expected)
 
 
-    def check_user_aggregation(self):
+    def test_user_aggregation(self):
         """check that the sa_interpolation accepts user-defined aggregates"""
 
         user_cases = []
@@ -128,7 +128,7 @@
 
 
 
-class TestFitCandidates(NumpyTestCase):
+class TestFitCandidates(TestCase):
     def setUp(self):
         self.cases = []
 
@@ -163,7 +163,7 @@
         self.cases.append((csr_matrix((ones(6),array([1,3,0,2,1,0]),array([0,0,1,2,2,3,4,5,5,6])),shape=(9,4)), vstack((ones(9),arange(9),arange(9)**2)).T ))
         self.cases.append((csr_matrix((ones(6),array([1,3,0,2,1,0]),array([0,0,1,2,2,3,4,5,5,6])),shape=(9,4)), vstack((ones(9),arange(9))).T ))
 
-    def check_all_cases(self):
+    def test_all_cases(self):
         """Test case where aggregation includes all fine nodes"""
 
         def mask_candidate(AggOp,candidates):
@@ -194,7 +194,7 @@
 ##            assert_almost_equal(Q*(Q.T*fine_candidates),fine_candidates)
 
 
-class TestSASolverPerformance(NumpyTestCase):
+class TestSASolverPerformance(TestCase):
     def setUp(self):
         self.cases = []
 
@@ -203,7 +203,7 @@
         # TODO add unstructured tests
 
 
-    def check_basic(self):
+    def test_basic(self):
         """check that method converges at a reasonable rate"""
 
         for A,candidates in self.cases:
@@ -220,7 +220,7 @@
 
             assert(avg_convergence_ratio < 0.5)
 
-    def check_DAD(self):
+    def test_DAD(self):
         for A,candidates in self.cases:
 
             x = rand(A.shape[0])
@@ -326,4 +326,4 @@
 
 
 if __name__ == '__main__':
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/multigrid/tests/test_utils.py
===================================================================
--- trunk/scipy/sandbox/multigrid/tests/test_utils.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/multigrid/tests/test_utils.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,4 +1,4 @@
-from numpy.testing import *
+from scipy.testing import *
 
 import numpy
 import scipy
@@ -7,16 +7,16 @@
 from scipy.sparse import csr_matrix
 from scipy.linalg import norm
 
-set_package_path()
+
 from scipy.sandbox.multigrid.utils import approximate_spectral_radius, \
                                           infinity_norm, diag_sparse, \
                                           symmetric_rescaling, \
                                           expand_into_blocks
-restore_path()
 
 
-class TestUtils(NumpyTestCase):
-    def check_approximate_spectral_radius(self):
+
+class TestUtils(TestCase):
+    def test_approximate_spectral_radius(self):
         cases = []
 
         cases.append( matrix([[-4]]) )
@@ -38,7 +38,7 @@
       
         #TODO test larger matrices
     
-    def check_infinity_norm(self):
+    def test_infinity_norm(self):
         A = matrix([[-4]])
         assert_equal(infinity_norm(csr_matrix(A)),4)
 
@@ -51,7 +51,7 @@
         A = matrix([[1.3,-4.7,0],[-2.23,5.5,0],[9,0,-2]])
         assert_equal(infinity_norm(csr_matrix(A)),11)
 
-    def check_diag_sparse(self):
+    def test_diag_sparse(self):
         #check sparse -> array
         A = matrix([[-4]])
         assert_equal(diag_sparse(csr_matrix(A)),[-4])
@@ -79,7 +79,7 @@
         assert_equal(diag_sparse(array([1.3,5.5,-2])).todense(),csr_matrix(A).todense())
 
 
-    def check_symmetric_rescaling(self):
+    def test_symmetric_rescaling(self):
         cases = []
         cases.append( diag_sparse(array([1,2,3,4])) )
         cases.append( diag_sparse(array([1,0,3,4])) )
@@ -105,7 +105,7 @@
             D_sqrt,D_sqrt_inv = diag_sparse(D_sqrt),diag_sparse(D_sqrt_inv)
             assert_almost_equal((D_sqrt_inv*A*D_sqrt_inv).todense(), DAD.todense())
 
-    def check_expand_into_blocks(self):
+    def test_expand_into_blocks(self):
         cases = []
         cases.append( ( matrix([[1]]), (1,2) ) )
         cases.append( ( matrix([[1]]), (2,1) ) )
@@ -129,4 +129,4 @@
 
 
 if __name__ == '__main__':
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/numexpr/__init__.py
===================================================================
--- trunk/scipy/sandbox/numexpr/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/numexpr/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,7 +1,4 @@
-from numexpr.info import __doc__
-from numexpr.expressions import E
-from numexpr.compiler import numexpr, disassemble, evaluate
+from scipy.sandbox.numexpr.info import __doc__
+from scipy.sandbox.numexpr.expressions import E
+from scipy.sandbox.numexpr.compiler import numexpr, disassemble, evaluate
 
-def test(level=1, verbosity=1):
-    from numpy.testing import NumpyTest
-    NumpyTest().test(level, verbosity)

Modified: trunk/scipy/sandbox/numexpr/compiler.py
===================================================================
--- trunk/scipy/sandbox/numexpr/compiler.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/numexpr/compiler.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,7 +1,7 @@
 import sys
 import numpy
 
-from numexpr import interpreter, expressions
+from scipy.sandbox.numexpr import interpreter, expressions
 
 typecode_to_kind = {'b': 'bool', 'i': 'int', 'l': 'long', 'f': 'float',
                     'c': 'complex', 's': 'str', 'n' : 'none'}

Modified: trunk/scipy/sandbox/numexpr/expressions.py
===================================================================
--- trunk/scipy/sandbox/numexpr/expressions.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/numexpr/expressions.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -6,7 +6,7 @@
 
 import numpy
 
-from numexpr import interpreter
+from scipy.sandbox.numexpr import interpreter
 
 class Expression(object):
     def __init__(self):

Modified: trunk/scipy/sandbox/numexpr/tests/test_numexpr.py
===================================================================
--- trunk/scipy/sandbox/numexpr/tests/test_numexpr.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/numexpr/tests/test_numexpr.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,31 +1,32 @@
 import new
-from numpy import *
-from numpy.testing import *
+from numpy import array, arange, sin, zeros, sum, int32, empty, \
+     prod, uint16, complex_, float64, rec
+from scipy.testing import *
 
-set_package_path()
-from numexpr import E, numexpr, evaluate, disassemble
-restore_path()
 
-class test_numexpr(NumpyTestCase):
-    def check_simple(self):
+from scipy.sandbox.numexpr import E, numexpr, evaluate, disassemble
+
+
+class test_numexpr(TestCase):
+    def test_simple(self):
         ex = 2.0 * E.a + 3.0 * E.b * E.c
         func = numexpr(ex, signature=[('a', float), ('b', float), ('c', float)])
         x = func(array([1., 2, 3]), array([4., 5, 6]), array([7., 8, 9]))
         assert_array_equal(x, array([  86.,  124.,  168.]))
 
-    def check_simple_expr_small_array(self):
+    def test_simple_expr_small_array(self):
         func = numexpr(E.a)
         x = arange(100.0)
         y = func(x)
         assert_array_equal(x, y)
 
-    def check_simple_expr(self):
+    def test_simple_expr(self):
         func = numexpr(E.a)
         x = arange(1e5)
         y = func(x)
         assert_array_equal(x, y)
 
-    def check_rational_expr(self):
+    def test_rational_expr(self):
         func = numexpr((E.a + 2.0*E.b) / (1 + E.a + 4*E.b*E.b))
         a = arange(1e5)
         b = arange(1e5) * 0.1
@@ -33,7 +34,7 @@
         y = func(a, b)
         assert_array_equal(x, y)
 
-    def check_reductions(self):
+    def test_reductions(self):
         # Check that they compile OK.
         assert_equal(disassemble(numexpr("sum(x**2+2, axis=None)", [('x', float)])),
                     [('mul_fff', 't3', 'r1[x]', 'r1[x]'),
@@ -72,7 +73,7 @@
         assert_equal(evaluate("sum(x**2+2,axis=0)"), sum(x**2+2,axis=0))
         assert_equal(evaluate("prod(x**2+2,axis=0)"), prod(x**2+2,axis=0))
 
-    def check_axis(self):
+    def test_axis(self):
         y = arange(9.0).reshape(3,3)
         try:
             evaluate("sum(y, axis=2)")
@@ -90,37 +91,37 @@
 
 
 
-    def check_r0_reuse(self):
+    def test_r0_reuse(self):
         assert_equal(disassemble(numexpr("x**2+2", [('x', float)])),
                     [('mul_fff', 'r0', 'r1[x]', 'r1[x]'),
                      ('add_fff', 'r0', 'r0', 'c2[2.0]')])
 
-class test_evaluate(NumpyTestCase):
-    def check_simple(self):
+class test_evaluate(TestCase):
+    def test_simple(self):
         a = array([1., 2., 3.])
         b = array([4., 5., 6.])
         c = array([7., 8., 9.])
         x = evaluate("2*a + 3*b*c")
         assert_array_equal(x, array([  86.,  124.,  168.]))
 
-    def check_simple_expr_small_array(self):
+    def test_simple_expr_small_array(self):
         x = arange(100.0)
         y = evaluate("x")
         assert_array_equal(x, y)
 
-    def check_simple_expr(self):
+    def test_simple_expr(self):
         x = arange(1e5)
         y = evaluate("x")
         assert_array_equal(x, y)
 
-    def check_rational_expr(self):
+    def test_rational_expr(self):
         a = arange(1e5)
         b = arange(1e5) * 0.1
         x = (a + 2*b) / (1 + a + 4*b*b)
         y = evaluate("(a + 2*b) / (1 + a + 4*b*b)")
         assert_array_equal(x, y)
 
-    def check_complex_expr(self):
+    def test_complex_expr(self):
         def complex(a, b):
             c = zeros(a.shape, dtype=complex_)
             c.real = a
@@ -135,7 +136,7 @@
         assert_array_almost_equal(x, y)
 
 
-    def check_complex_strides(self):
+    def test_complex_strides(self):
         a = arange(100).reshape(10,10)[::2]
         b = arange(50).reshape(5,10)
         assert_array_equal(evaluate("a+b"), a+b)
@@ -148,7 +149,7 @@
         assert_array_equal(evaluate("a0+c1"), a0+c1)
 
 
-    def check_broadcasting(self):
+    def test_broadcasting(self):
         a = arange(100).reshape(10,10)[::2]
         c = arange(10)
         d = arange(5).reshape(5,1)
@@ -157,20 +158,20 @@
         expr = numexpr("2.0*a+3.0*c",[('a',float),('c', float)])
         assert_array_equal(expr(a,c), 2.0*a+3.0*c)
 
-    def check_all_scalar(self):
+    def test_all_scalar(self):
         a = 3.
         b = 4.
         assert_equal(evaluate("a+b"), a+b)
         expr = numexpr("2*a+3*b",[('a',float),('b', float)])
         assert_equal(expr(a,b), 2*a+3*b)
 
-    def check_run(self):
+    def test_run(self):
         a = arange(100).reshape(10,10)[::2]
         b = arange(10)
         expr = numexpr("2*a+3*b",[('a',float),('b', float)])
         assert_array_equal(expr(a,b), expr.run(a,b))
 
-    def check_illegal_value(self):
+    def test_illegal_value(self):
         a = arange(3)
         try:
             evaluate("a < [0, 0, 0]")
@@ -239,7 +240,7 @@
 
 class Skip(Exception): pass
 
-class test_expressions(NumpyTestCase):
+class test_expressions(TestCase):
     pass
 
 def generate_check_expressions():
@@ -306,21 +307,21 @@
 
 generate_check_expressions()
 
-class test_int32_int64(NumpyTestCase):
-    def check_small_long(self):
+class test_int32_int64(TestCase):
+    def test_small_long(self):
         # Small longs should not be downgraded to ints.
         res = evaluate('42L')
         assert_array_equal(res, 42)
         self.assertEqual(res.dtype.name, 'int64')
 
-    def check_big_int(self):
+    def test_big_int(self):
         # Big ints should be promoted to longs.
         # This test may only fail under 64-bit platforms.
         res = evaluate('2**40')
         assert_array_equal(res, 2**40)
         self.assertEqual(res.dtype.name, 'int64')
 
-    def check_long_constant_promotion(self):
+    def test_long_constant_promotion(self):
         int32array = arange(100, dtype='int32')
         res = int32array * 2
         res32 = evaluate('int32array * 2')
@@ -330,7 +331,7 @@
         self.assertEqual(res32.dtype.name, 'int32')
         self.assertEqual(res64.dtype.name, 'int64')
 
-    def check_int64_array_promotion(self):
+    def test_int64_array_promotion(self):
         int32array = arange(100, dtype='int32')
         int64array = arange(100, dtype='int64')
         respy = int32array * int64array
@@ -338,7 +339,7 @@
         assert_array_equal(respy, resnx)
         self.assertEqual(resnx.dtype.name, 'int64')
 
-class test_strings(NumpyTestCase):
+class test_strings(TestCase):
     BLOCK_SIZE1 = 128
     BLOCK_SIZE2 = 8
     str_list1 = ['foo', 'bar', '', '  ']
@@ -348,7 +349,7 @@
     str_array2 = array(str_list2 * str_nloops)
     str_constant = 'doodoo'
 
-    def check_null_chars(self):
+    def test_null_chars(self):
         str_list = [
             '\0\0\0', '\0\0foo\0', '\0\0foo\0b', '\0\0foo\0b\0',
             'foo\0', 'foo\0b', 'foo\0b\0', 'foo\0bar\0baz\0\0' ]
@@ -356,14 +357,14 @@
             r = evaluate('s')
             self.assertEqual(s, r.tostring())  # check *all* stored data
 
-    def check_compare_copy(self):
+    def test_compare_copy(self):
         sarr = self.str_array1
         expr = 'sarr'
         res1 = eval(expr)
         res2 = evaluate(expr)
         assert_array_equal(res1, res2)
 
-    def check_compare_array(self):
+    def test_compare_array(self):
         sarr1 = self.str_array1
         sarr2 = self.str_array2
         expr = 'sarr1 >= sarr2'
@@ -371,7 +372,7 @@
         res2 = evaluate(expr)
         assert_array_equal(res1, res2)
 
-    def check_compare_variable(self):
+    def test_compare_variable(self):
         sarr = self.str_array1
         svar = self.str_constant
         expr = 'sarr >= svar'
@@ -379,20 +380,20 @@
         res2 = evaluate(expr)
         assert_array_equal(res1, res2)
 
-    def check_compare_constant(self):
+    def test_compare_constant(self):
         sarr = self.str_array1
         expr = 'sarr >= %r' % self.str_constant
         res1 = eval(expr)
         res2 = evaluate(expr)
         assert_array_equal(res1, res2)
 
-    def check_add_string_array(self):
+    def test_add_string_array(self):
         sarr1 = self.str_array1
         sarr2 = self.str_array2
         expr = 'sarr1 + sarr2'
         self.assert_missing_op('add_sss', expr, locals())
 
-    def check_add_numeric_array(self):
+    def test_add_numeric_array(self):
         sarr = self.str_array1
         narr = arange(len(sarr), dtype='int32')
         expr = 'sarr >= narr'
@@ -408,7 +409,7 @@
         else:
             self.fail(msg)
 
-    def check_compare_prefix(self):
+    def test_compare_prefix(self):
         # Check comparing two strings where one is a prefix of the
         # other.
         for s1, s2 in [ ('foo', 'foobar'), ('foo', 'foo\0bar'),
@@ -429,8 +430,8 @@
 # because in 64-bit machines 'c2' is unaligned.  However, this should
 # check most platforms where, while not unaligned, 'len(datatype) >
 # boundary_alignment' is fullfilled.
-class test_irregular_stride(NumpyTestCase):
-    def check_select(self):
+class test_irregular_stride(TestCase):
+    def test_select(self):
         f0 = arange(10, dtype=int32)
         f1 = arange(10, dtype=float64)
 
@@ -447,4 +448,4 @@
 
 
 if __name__ == '__main__':
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/pyloess/mpyloess.py
===================================================================
--- trunk/scipy/sandbox/pyloess/mpyloess.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/pyloess/mpyloess.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -42,9 +42,8 @@
 nempty = numeric.empty
 nlogical_not = numpy.logical_not
 
-import maskedarray.core
-from maskedarray.core import masked, nomask, mask_or
-from maskedarray.core import masked_array as marray
+from scipy.sandbox.maskedarray.core import masked, nomask, mask_or, \
+     masked_array as marray
 
 import _lowess, _stl, _mloess
 

Modified: trunk/scipy/sandbox/pyloess/tests/test_mpyloess.py
===================================================================
--- trunk/scipy/sandbox/pyloess/tests/test_mpyloess.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/pyloess/tests/test_mpyloess.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -18,27 +18,24 @@
 import numpy.core.numeric as numeric
 fromiter = numpy.fromiter
 
-import maskedarray
+from scipy.sandbox import maskedarray
 marray = maskedarray.masked_array
 masked_values = maskedarray.masked_values
 
-from numpy.testing import NumpyTest, NumpyTestCase
-from maskedarray.testutils import build_err_msg, \
+from scipy.testing import *
+from scipy.sandbox.maskedarray.testutils import build_err_msg, \
         assert_equal, assert_almost_equal
 
+from scipy.sandbox.pyloess.mpyloess import lowess, stl, loess, loess_anova
 
-import mpyloess
-reload(mpyloess)
-from mpyloess import lowess, stl, loess, loess_anova
-
 #####---------------------------------------------------------------------------
 #---- --- LOWESS ---
 #####---------------------------------------------------------------------------
-class TestLowess(NumpyTestCase):
+class TestLowess(TestCase):
     "Test class for lowess."
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         X = marray([ 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8,10,12,14,50])
         Y = marray([18, 2,15, 6,10, 4,16,11, 7, 3,14,17,20,12, 9,13, 1, 8, 5,19])
         idx = X.argsort()
@@ -95,11 +92,11 @@
 #####---------------------------------------------------------------------------
 #---- --- STL ---
 #####---------------------------------------------------------------------------
-class TestStl(NumpyTestCase):
+class TestStl(TestCase):
     "Tests STL."
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         # Get CO2 data ................
         filename = os.path.join('tests','co2_data')
         F = open(filename, 'r')
@@ -141,11 +138,11 @@
 #---- --- LOESS ---
 #####---------------------------------------------------------------------------
 
-class TestLoess2D(NumpyTestCase):
+class TestLoess2D(TestCase):
     "Test class for lowess."
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         dfile = open(os.path.join('tests','madeup_data'), 'r')
         dfile.readline()
         x = fromiter((float(v) for v in dfile.readline().rstrip().split()),
@@ -292,11 +289,11 @@
 #####---------------------------------------------------------------------------
 #---- --- test 1D ---
 #####---------------------------------------------------------------------------
-class TestLoessGas(NumpyTestCase):
+class TestLoessGas(TestCase):
     "Test class for lowess."
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         NOx = marray([4.818, 2.849, 3.275, 4.691, 4.255, 5.064, 2.118, 4.602,
                       2.286, 0.970, 3.965, 5.344, 3.834, 1.990, 5.199, 5.283,
                       3.752, 0.537, 1.640, 5.055, 4.937, 1.561])
@@ -433,4 +430,4 @@
 
 ########################################################################
 if __name__ == '__main__':
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/pyloess/tests/test_pyloess.py
===================================================================
--- trunk/scipy/sandbox/pyloess/tests/test_pyloess.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/pyloess/tests/test_pyloess.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -21,22 +21,18 @@
 narray = numpy.array
 
 
-from numpy.testing import NumpyTest, NumpyTestCase
-from numpy.testing.utils import build_err_msg, \
-        assert_equal, assert_almost_equal
+from scipy.testing import *
 
-import pyloess
-reload(pyloess)
-from pyloess import lowess, stl, loess, loess_anova
+from scipy.sandbox.pyloess import lowess, stl, loess, loess_anova
 
 #####---------------------------------------------------------------------------
 #---- --- LOWESS ---
 #####---------------------------------------------------------------------------
-class TestLowess(NumpyTestCase):
+class TestLowess(TestCase):
     "Test class for lowess."
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         X = narray([ 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8,10,12,14,50])
         Y = narray([18, 2,15, 6,10, 4,16,11, 7, 3,14,17,20,12, 9,13, 1, 8, 5,19])
         idx = X.argsort()
@@ -78,11 +74,11 @@
 #####---------------------------------------------------------------------------
 #---- --- STL ---
 #####---------------------------------------------------------------------------
-class TestStl(NumpyTestCase):
+class TestStl(TestCase):
     "Tests STL."
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         # Get CO2 data ................
         filename = os.path.join('tests','co2_data')
         F = open(filename, 'r')
@@ -124,11 +120,11 @@
 #---- --- LOESS ---
 #####---------------------------------------------------------------------------
 
-class TestLoess2d(NumpyTestCase):
+class TestLoess2d(TestCase):
     "Test class for lowess."
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         dfile = open(os.path.join('tests','madeup_data'), 'r')
         dfile.readline()
         x = fromiter((float(v) for v in dfile.readline().rstrip().split()),
@@ -273,11 +269,11 @@
 #####---------------------------------------------------------------------------
 #---- --- test 2D
 #####---------------------------------------------------------------------------
-class TestLoessGas(NumpyTestCase):
+class TestLoessGas(TestCase):
     "Test class for lowess."
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         NOx = numpy.array([4.818, 2.849, 3.275, 4.691, 4.255, 5.064, 2.118, 4.602,
                            2.286, 0.970, 3.965, 5.344, 3.834, 1.990, 5.199, 5.283,
                            3.752, 0.537, 1.640, 5.055, 4.937, 1.561])
@@ -387,4 +383,4 @@
 
 ########################################################################
 if __name__ == '__main__':
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/rbf/__init__.py
===================================================================
--- trunk/scipy/sandbox/rbf/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/rbf/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -7,5 +7,5 @@
 from rbf import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/sandbox/rbf/tests/test_rbf.py
===================================================================
--- trunk/scipy/sandbox/rbf/tests/test_rbf.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/rbf/tests/test_rbf.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -2,23 +2,23 @@
 # Created by John Travers, Robert Hetland, 2007
 """ Test functions for rbf module """
 
-from numpy.testing import *
+from scipy.testing import *
 from numpy import linspace, sin, random, exp
 
-set_package_path()
-from rbf.rbf import Rbf
-restore_path()
 
-class TestRbf1d(NumpyTestCase):
-    def check_multiquadrics(self):
+from scipy.sandbox.rbf.rbf import Rbf
+
+
+class TestRbf1d(TestCase):
+    def test_multiquadrics(self):
         x = linspace(0,10,9)
         y = sin(x)
         rbf = Rbf(x, y)
         yi = rbf(x)
         assert_array_almost_equal(y, yi)
 
-class TestRbf2d(NumpyTestCase):
-    def check_multiquadrics(self):
+class TestRbf2d(TestCase):
+    def test_multiquadrics(self):
         x = random.rand(50,1)*4-2
         y = random.rand(50,1)*4-2
         z = x*exp(-x**2-y**2)
@@ -27,8 +27,8 @@
         zi.shape = x.shape
         assert_array_almost_equal(z, zi)
 
-class TestRbf3d(NumpyTestCase):
-    def check_multiquadrics(self):
+class TestRbf3d(TestCase):
+    def test_multiquadrics(self):
         x = random.rand(50,1)*4-2
         y = random.rand(50,1)*4-2
         z = random.rand(50,1)*4-2
@@ -39,4 +39,4 @@
         assert_array_almost_equal(di, d)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/spline/__init__.py
===================================================================
--- trunk/scipy/sandbox/spline/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/spline/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -10,5 +10,5 @@
 from spline import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/sandbox/spline/tests/test_fitpack.py
===================================================================
--- trunk/scipy/sandbox/spline/tests/test_fitpack.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/spline/tests/test_fitpack.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -12,20 +12,20 @@
 """
 
 import sys
-from numpy.testing import *
+from scipy.testing import *
 from numpy import array, arange, around, pi, sin, ravel, zeros, asarray
 
-set_package_path()
-from spline.fitpack import splprep, splrep, splev, sproot, splint, spalde
-from spline.fitpack import bisplev, bisplrep, splprep
-restore_path()
 
+from scipy.sandbox.spline.fitpack import splprep, splrep, splev, sproot, \
+     splint, spalde, bisplev, bisplrep, splprep
+
+
 set_local_path()
 from dierckx_test_data import *
 restore_path()
 
-class TestSplrepSplev(NumpyTestCase):
-    def check_curfit_against_dierckx_smth(self):
+class TestSplrepSplev(TestCase):
+    def test_curfit_against_dierckx_smth(self):
         x,y = curfit_test['x'],curfit_test['y']
         k,s = curfit_test_smth['k'],curfit_test_smth['s']
         iopt = curfit_test_smth['iopt']
@@ -42,7 +42,7 @@
             assert_array_almost_equal(around(sp,1),
                                       curfit_test_smth['sp'][i])
 
-    def check_curfit_against_dierckx_lsq(self):
+    def test_curfit_against_dierckx_lsq(self):
         """ Test against results obtined from the pure fortran routines.
 
             Here we check simple spline creation and evaluation.
@@ -60,7 +60,7 @@
             assert_array_almost_equal(around(sp,1),
                                       curfit_test_lsq['sp'][i])
 
-    def check_percur_against_dierckx(self):
+    def test_percur_against_dierckx(self):
         x,y = percur_test['x'], percur_test['y']
         k,s = percur_test['k'], percur_test['s']
         iopt, res = percur_test['iopt'], percur_test['res']
@@ -83,8 +83,8 @@
             yy = asarray(splev(x,tck))
             assert_array_almost_equal(yy,sp[i], decimal=3)
 
-class TestSplprepSplev(NumpyTestCase):
-    def check_parcur_against_dierckx(self):
+class TestSplprepSplev(TestCase):
+    def test_parcur_against_dierckx(self):
         xa,xo = parcur_test['xa'], parcur_test['xo']
         k,s = parcur_test['k'], parcur_test['s']
         u = parcur_test['u']
@@ -120,7 +120,7 @@
             yy[1::2] = y[1]
             assert_array_almost_equal(yy,sp[i], decimal=3)
 
-    def check_clocur_against_dierckx(self):
+    def test_clocur_against_dierckx(self):
         xa,xo = clocur_test['xa'], clocur_test['xo']
         k,s = clocur_test['k'], clocur_test['s']
         u = clocur_test['u']
@@ -155,8 +155,8 @@
             yy[1::2] = y[1,:-1]
             assert_array_almost_equal(yy,sp[i], decimal=3)
 
-class TestSplintSpalde(NumpyTestCase):
-    def check_splint_spalde(self):
+class TestSplintSpalde(TestCase):
+    def test_splint_spalde(self):
         per = [0, 1, 0]
         N = [20, 20, 50]
         ia = [0, 0, 0.2*pi]
@@ -178,8 +178,8 @@
                         assert_almost_equal(1, ddr/f1(dx,d), decimal=2)
                     d=d+1
 
-class TestSplder(NumpyTestCase):
-    def check_splder(self):
+class TestSplder(TestCase):
+    def test_splder(self):
         N = 50
         a,b = 0,2*pi
         dx = 0.2*pi
@@ -192,8 +192,8 @@
             d2 = splev(dx,tck,der=1)
             assert_almost_equal(1, dr[1]/f1(dx,1.0), decimal=2)
 
-class TestSproot(NumpyTestCase):
-    def check_sproot(self):
+class TestSproot(TestCase):
+    def test_sproot(self):
         a=0
         b=15
         N=20
@@ -204,7 +204,7 @@
         ex = array([0.0, pi, 2.0*pi, 3.0*pi, 4.0*pi])
         assert_array_almost_equal(sproot(tck),ex, decimal=3)
 
-class TestBisplevBisplrep(NumpyTestCase):
+class TestBisplevBisplrep(TestCase):
     def test_bisplev_bisplrep(self):
         f=f2; kx=3; ky=3; xb=0; xe=2*pi
         yb=0; ye=2*pi; Nx=20; Ny=20; s=0
@@ -219,8 +219,8 @@
         v2.shape=len(tt[0]),len(tt[1])
         assert_almost_equal(0.0, norm2(ravel(v1-v2)), decimal=5)
 
-class TestParcur(NumpyTestCase):
-    def check_parcur(self):
+class TestParcur(TestCase):
+    def test_parcur(self):
         f=f1; per=0; s=0; a=0; b=2*pi;
         N=[20,50]
         ia=0; ib=2*pi; dx=0.2*pi
@@ -239,4 +239,4 @@
                         around(abs(splev(uv[0],tck)-f(uv[0])),2),decimal=1)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/spline/tests/test_spline.py
===================================================================
--- trunk/scipy/sandbox/spline/tests/test_spline.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/spline/tests/test_spline.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -13,22 +13,20 @@
 """
 
 import sys
-from numpy.testing import *
+from scipy.testing import *
 from numpy import array, arange, around, pi, sin, cos
 
-set_package_path()
-from spline.spline import UnivariateSpline,LSQUnivariateSpline,\
-     InterpolatedUnivariateSpline
-from spline.spline import LSQBivariateSpline, SmoothBivariateSpline,\
+
+from scipy.sandbox.spline.spline import UnivariateSpline,LSQUnivariateSpline,\
+     InterpolatedUnivariateSpline, LSQBivariateSpline, SmoothBivariateSpline,\
      RectBivariateSpline
-restore_path()
 
 set_local_path()
 from dierckx_test_data import *
 restore_path()
 
-class TestUnivariateSpline(NumpyTestCase):
-    def check_linear_constant(self):
+class TestUnivariateSpline(TestCase):
+    def test_linear_constant(self):
         x = [1,2,3]
         y = [3,3,3]
         lut = UnivariateSpline(x,y,k=1)
@@ -37,7 +35,7 @@
         assert_almost_equal(lut.get_residual(),0.0)
         assert_array_almost_equal(lut([1,1.5,2]),[3,3,3])
 
-    def check_linear_1d(self):
+    def test_linear_1d(self):
         x = [1,2,3]
         y = [0,2,4]
         lut = UnivariateSpline(x,y,k=1)
@@ -46,7 +44,7 @@
         assert_almost_equal(lut.get_residual(),0.0)
         assert_array_almost_equal(lut([1,1.5,2]),[0,1,2])
 
-    def check_curfit_against_dierckx(self):
+    def test_curfit_against_dierckx(self):
         """ Test against results obtined from the pure fortran routines.
 
             Here we check simple spline creation and evaluation.
@@ -70,7 +68,7 @@
             assert_array_almost_equal(around(uspl(x),1),
                                       curfit_test_smth['sp'][i])
 
-    def check_spint_spalde(self):
+    def test_spint_spalde(self):
         per = [0, 0, 0]
         N = [20, 20, 50]
         ia = [0, 0, 0.2*pi]
@@ -92,7 +90,7 @@
                         assert_almost_equal(1, ddr/f1(dx,d), decimal=2)
                     d=d+1
 
-    def check_sproot(self):
+    def test_sproot(self):
         a=0
         b=15
         N=20
@@ -103,8 +101,8 @@
         ex = array([0.0, pi, 2.0*pi, 3.0*pi, 4.0*pi])
         assert_array_almost_equal(uspl.roots(),ex, decimal=3)
 
-class TestLSQUnivariateSpline(NumpyTestCase):
-    def check_curfit_against_dierckx(self):
+class TestLSQUnivariateSpline(TestCase):
+    def test_curfit_against_dierckx(self):
         """ Test against results obtined from the pure fortran routines.
 
             Here we check simple spline creation and evaluation.
@@ -121,8 +119,8 @@
             assert_array_almost_equal(around(lsquspl(x),1),
                                       curfit_test_lsq['sp'][i])
 
-class TestLSQBivariateSpline(NumpyTestCase):
-    def check_linear_constant(self):
+class TestLSQBivariateSpline(TestCase):
+    def test_linear_constant(self):
         x = [1,1,1,2,2,2,3,3,3]
         y = [1,2,3,1,2,3,1,2,3]
         z = [3,3,3,3,3,3,3,3,3]
@@ -134,8 +132,8 @@
         #print lut.get_coeffs()
         #print lut.get_residual()
 
-class TestSmoothBivariateSpline(NumpyTestCase):
-    def check_linear_constant(self):
+class TestSmoothBivariateSpline(TestCase):
+    def test_linear_constant(self):
         x = [1,1,1,2,2,2,3,3,3]
         y = [1,2,3,1,2,3,1,2,3]
         z = [3,3,3,3,3,3,3,3,3]
@@ -145,7 +143,7 @@
         assert_almost_equal(lut.get_residual(),0.0)
         assert_array_almost_equal(lut([1,1.5,2],[1,1.5]),[[3,3],[3,3],[3,3]])
 
-    def check_linear_1d(self):
+    def test_linear_1d(self):
         x = [1,1,1,2,2,2,3,3,3]
         y = [1,2,3,1,2,3,1,2,3]
         z = [0,0,0,2,2,2,4,4,4]
@@ -155,8 +153,8 @@
         assert_almost_equal(lut.get_residual(),0.0)
         assert_array_almost_equal(lut([1,1.5,2],[1,1.5]),[[0,0],[1,1],[2,2]])
 
-class TestRectBivariateSpline(NumpyTestCase):
-    def check_defaults(self):
+class TestRectBivariateSpline(TestCase):
+    def test_defaults(self):
         x = array([1,2,3,4,5])
         y = array([1,2,3,4,5])
         z = array([[1,2,1,2,1],[1,2,1,2,1],[1,2,3,2,1],[1,2,2,2,1],[1,2,1,2,1]])
@@ -164,4 +162,4 @@
         assert_array_almost_equal(lut(x,y),z)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/timeseries/dates.py
===================================================================
--- trunk/scipy/sandbox/timeseries/dates.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/dates.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -25,7 +25,7 @@
 import numpy.core.numerictypes as ntypes
 from numpy.core.numerictypes import generic
 
-import maskedarray as MA
+import scipy.sandbox.maskedarray as MA
 
 from parser import DateFromString, DateTimeFromString
 

Modified: trunk/scipy/sandbox/timeseries/extras.py
===================================================================
--- trunk/scipy/sandbox/timeseries/extras.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/extras.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -12,8 +12,8 @@
 
 
 import numpy
-import maskedarray
-from maskedarray import masked
+import scipy.sandbox.maskedarray
+from scipy.sandbox.maskedarray import masked
 
 import const as _c
 from tseries import TimeSeries

Modified: trunk/scipy/sandbox/timeseries/lib/filters.py
===================================================================
--- trunk/scipy/sandbox/timeseries/lib/filters.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/lib/filters.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -17,8 +17,8 @@
 
 from scipy.signal import convolve, get_window
 
-import maskedarray as MA
-from maskedarray import MaskedArray, nomask, getmask, getmaskarray, masked
+import scipy.sandbox.maskedarray as MA
+from scipy.sandbox.maskedarray import MaskedArray, nomask, getmask, getmaskarray, masked
 marray = MA.array
 
 from moving_funcs import mov_average_expw, cmov_average, cmov_mean, \

Modified: trunk/scipy/sandbox/timeseries/lib/interpolate.py
===================================================================
--- trunk/scipy/sandbox/timeseries/lib/interpolate.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/lib/interpolate.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -14,9 +14,9 @@
 
 from scipy.interpolate import fitpack
 
-import maskedarray as MA
-from maskedarray.core import masked, nomask, getmask
-from maskedarray.extras import flatnotmasked_edges
+import scipy.sandbox.maskedarray as MA
+from scipy.sandbox.maskedarray.core import masked, nomask, getmask
+from scipy.sandbox.maskedarray.extras import flatnotmasked_edges
 marray = MA.array
 
 __all__ = [

Modified: trunk/scipy/sandbox/timeseries/lib/moving_funcs.py
===================================================================
--- trunk/scipy/sandbox/timeseries/lib/moving_funcs.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/lib/moving_funcs.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -23,11 +23,11 @@
 
 from scipy.signal import convolve, get_window
 
-import maskedarray as MA
-from maskedarray import MaskedArray, nomask, getmask, getmaskarray, masked
+import scipy.sandbox.maskedarray as MA
+from scipy.sandbox.maskedarray import MaskedArray, nomask, getmask, getmaskarray, masked
 marray = MA.array
 
-from timeseries.cseries import MA_mov_sum, MA_mov_median, MA_mov_min, \
+from scipy.sandbox.timeseries.cseries import MA_mov_sum, MA_mov_median, MA_mov_min, \
                                MA_mov_max
 
 def _process_result_dict(orig_data, result_dict):

Modified: trunk/scipy/sandbox/timeseries/lib/tests/test_interpolate.py
===================================================================
--- trunk/scipy/sandbox/timeseries/lib/tests/test_interpolate.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/lib/tests/test_interpolate.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -11,20 +11,20 @@
 import numpy as N
 import numpy.core.numeric as numeric
 
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import *
 
-import maskedarray.testutils
-from maskedarray.testutils import *
+from scipy.sandbox.maskedarray.testutils import *
 
-import maskedarray.core as coremodule
-from maskedarray.core import MaskedArray, masked
+import scipy.sandbox.maskedarray.core as coremodule
+from scipy.sandbox.maskedarray.core import MaskedArray, masked
 
-from timeseries.lib.interpolate import backward_fill, forward_fill, interp_masked1d
+from scipy.sandbox.timeseries.lib.interpolate import \
+     backward_fill, forward_fill, interp_masked1d
 
-class TestFuncs(NumpyTestCase):
+class TestFuncs(TestCase):
 
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         self.mask = [1,0,1,0,0,1,1,0,0,0]
         self.data = numeric.arange(10)
         self.test_array = masked_array(self.data, mask=self.mask)
@@ -61,4 +61,4 @@
 ###############################################################################
 #------------------------------------------------------------------------------
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py
===================================================================
--- trunk/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -13,25 +13,24 @@
 import numpy as N
 import numpy.core.numeric as numeric
 
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import *
 
-import maskedarray.testutils
-from maskedarray.testutils import *
+from scipy.sandbox.maskedarray.testutils import *
 
-import maskedarray as MA
-import maskedarray.core as coremodule
-from maskedarray.core import MaskedArray, masked
-from maskedarray import mstats
+import scipy.sandbox.maskedarray as MA
+import scipy.sandbox.maskedarray.core as coremodule
+from scipy.sandbox.maskedarray.core import MaskedArray, masked
+from scipy.sandbox.maskedarray import mstats
 
-import timeseries as TS
-from timeseries import time_series, thisday
+import scipy.sandbox.timeseries as TS
+from scipy.sandbox.timeseries import time_series, thisday
 
-from timeseries.lib import moving_funcs as MF
+from scipy.sandbox.timeseries.lib import moving_funcs as MF
 
-class TestCMovAverage(NumpyTestCase):
+class TestCMovAverage(TestCase):
 
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         self.data = numeric.arange(25)
         self.maskeddata = MaskedArray(self.data)
         self.maskeddata[10] = masked
@@ -84,10 +83,10 @@
 
 
 
-class TestMovFuncs(NumpyTestCase):
+class TestMovFuncs(TestCase):
 
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         self.data = numeric.arange(25)
         self.maskeddata = MaskedArray(self.data)
         self.maskeddata[10] = masked
@@ -150,4 +149,4 @@
 
 #------------------------------------------------------------------------------
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/timeseries/report.py
===================================================================
--- trunk/scipy/sandbox/timeseries/report.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/report.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -59,8 +59,8 @@
 
 import sys
 import operator, types, copy
-import timeseries as ts
-import maskedarray as ma
+import tseries as ts
+import scipy.sandbox.maskedarray as ma
 
 __all__ = [
     'Report', 'wrap_onspace', 'wrap_onspace_strict',

Modified: trunk/scipy/sandbox/timeseries/tests/test_dates.py
===================================================================
--- trunk/scipy/sandbox/timeseries/tests/test_dates.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/tests/test_dates.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -16,28 +16,24 @@
 import numpy
 import numpy.core.fromnumeric  as fromnumeric
 import numpy.core.numeric as numeric
-from numpy.testing import NumpyTest, NumpyTestCase
-from numpy.testing.utils import build_err_msg
+from scipy.testing import *
 
-import maskedarray
-from maskedarray import masked_array
+from scipy.sandbox.maskedarray import masked_array
 
-import maskedarray.testutils
-from maskedarray.testutils import assert_equal, assert_array_equal
+from scipy.sandbox.maskedarray.testutils import assert_equal, assert_array_equal
 
-import timeseries as ts
-from timeseries import const as C
-from timeseries.parser import DateFromString, DateTimeFromString
-from timeseries import Date, DateArray,\
+import scipy.sandbox.timeseries as ts
+from scipy.sandbox.timeseries import const as C, Date, DateArray,\
     now, date_array, date_array_fromlist
-from timeseries.cseries import freq_dict
+from scipy.sandbox.timeseries.parser import DateFromString, DateTimeFromString
+from scipy.sandbox.timeseries.cseries import freq_dict
 
 
-class TestCreation(NumpyTestCase):
+class TestCreation(TestCase):
     "Base test class for MaskedArrays."
 
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
 
     def test_fromstrings(self):
         "Tests creation from list of strings"
@@ -140,11 +136,11 @@
         assert_equal(date_array(n, n+2), d)
         print "finished test_shortcuts"
 
-class TestDateProperties(NumpyTestCase):
+class TestDateProperties(TestCase):
     "Test properties such as year, month, weekday, etc...."
 
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
 
     def test_properties(self):
 
@@ -245,11 +241,11 @@
 
 def noWrap(item): return item
 
-class TestFreqConversion(NumpyTestCase):
+class TestFreqConversion(TestCase):
     "Test frequency conversion of date objects"
 
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         self.dateWrap = [(dArrayWrap, assert_array_equal),
                          (noWrap, assert_equal)]
 
@@ -833,11 +829,11 @@
             assert_func(date_S_end_of_minute.asfreq('T'), date_S_to_T)
 
 
-class TestMethods(NumpyTestCase):
+class TestMethods(TestCase):
     "Base test class for MaskedArrays."
 
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
 
     def test_getitem(self):
         "Tests getitem"
@@ -886,4 +882,4 @@
 ###############################################################################
 #------------------------------------------------------------------------------
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/timeseries/tests/test_extras.py
===================================================================
--- trunk/scipy/sandbox/timeseries/tests/test_extras.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/tests/test_extras.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -13,30 +13,29 @@
 
 
 import numpy
-from numpy.testing import NumpyTest, NumpyTestCase
-import maskedarray
-from maskedarray import masked
-from maskedarray.testutils import assert_equal, assert_almost_equal
+from scipy.testing import *
+import scipy.sandbox.maskedarray
+from scipy.sandbox.maskedarray import masked
+from scipy.sandbox.maskedarray.testutils import assert_equal, assert_almost_equal
 
-from timeseries import time_series, Date
-from timeseries import extras
-from timeseries.extras import *
+from scipy.sandbox.timeseries import time_series, Date, extras
+from scipy.sandbox.timeseries.extras import *
 
 #..............................................................................
-class TestMisc(NumpyTestCase):
+class TestMisc(TestCase):
     "Base test class for MaskedArrays."
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
     #
     def test_leapyear(self):
         leap = isleapyear([1900,1901,1902,1903,1904,2000,2001,2002,2003,2004])
         assert_equal(leap, [0,0,0,0,1,1,0,0,0,1])
 
 #..............................................................................
-class TestCountmissing(NumpyTestCase):
+class TestCountmissing(TestCase):
     #
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         data = time_series(numpy.arange(731),
                            start_date=Date(string='2003-01-01', freq='D'),
                            freq='D')
@@ -81,4 +80,4 @@
 ###############################################################################
 #------------------------------------------------------------------------------
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/timeseries/tests/test_timeseries.py
===================================================================
--- trunk/scipy/sandbox/timeseries/tests/test_timeseries.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/tests/test_timeseries.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -15,26 +15,23 @@
 from numpy import bool_, complex_, float_, int_, object_
 import numpy.core.fromnumeric  as fromnumeric
 import numpy.core.numeric as numeric
-from numpy.testing import NumpyTest, NumpyTestCase
-from numpy.testing.utils import build_err_msg
+from scipy.testing import *
 
-import maskedarray
-import maskedarray as MA
-from maskedarray import masked_array, masked, nomask
+import scipy.sandbox.maskedarray
+import scipy.sandbox.maskedarray as MA
+from scipy.sandbox.maskedarray import masked_array, masked, nomask
 
-import maskedarray.testutils
-from maskedarray.testutils import assert_equal, assert_array_equal
+from scipy.sandbox.maskedarray.testutils import assert_equal, assert_array_equal
 
-from timeseries import tseries
-from timeseries import Date, date_array_fromlist, date_array_fromrange, date_array, thisday
-from timeseries import time_series, TimeSeries, adjust_endpoints, \
-    mask_period, align_series, align_with, fill_missing_dates, tsmasked, \
-    concatenate, stack, split
+from scipy.sandbox.timeseries import tseries, Date, date_array_fromlist, \
+     date_array_fromrange, date_array, thisday, time_series, TimeSeries, \
+     adjust_endpoints, mask_period, align_series, align_with, \
+     fill_missing_dates, tsmasked, concatenate, stack, split
 
-class TestCreation(NumpyTestCase):
+class TestCreation(TestCase):
     "Base test class for MaskedArrays."
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         dlist = ['2007-01-%02i' % i for i in range(1,16)]
         dates = date_array_fromlist(dlist)
         data = masked_array(numeric.arange(15), mask=[1,0,0,0,0]*3)
@@ -117,10 +114,10 @@
         assert_equal(series._mask,[0,0,1])
 #...............................................................................
 
-class TestArithmetics(NumpyTestCase):
+class TestArithmetics(TestCase):
     "Some basic arithmetic tests"
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         dlist = ['2007-01-%02i' % i for i in range(1,16)]
         dates = date_array_fromlist(dlist)
         data = masked_array(numeric.arange(15), mask=[1,0,0,0,0]*3)
@@ -215,10 +212,10 @@
 
 #...............................................................................
 
-class TestGetitem(NumpyTestCase):
+class TestGetitem(TestCase):
     "Some getitem tests"
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         dlist = ['2007-01-%02i' % i for i in range(1,16)]
         dates = date_array_fromlist(dlist)
         data = masked_array(numeric.arange(15), mask=[1,0,0,0,0]*3, dtype=float_)
@@ -320,10 +317,10 @@
         assert_equal(series[:,:,0], series._data[:,:,0])
         assert_equal(series[:,:,0]._dates, series._dates)
 
-class TestFunctions(NumpyTestCase):
+class TestFunctions(TestCase):
     "Some getitem tests"
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         dlist = ['2007-01-%02i' % i for i in range(1,16)]
         dates = date_array_fromlist(dlist)
         data = masked_array(numeric.arange(15), mask=[1,0,0,0,0]*3)
@@ -635,4 +632,4 @@
 ###############################################################################
 #------------------------------------------------------------------------------
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/timeseries/tests/test_trecords.py
===================================================================
--- trunk/scipy/sandbox/timeseries/tests/test_trecords.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/tests/test_trecords.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -14,29 +14,27 @@
 
 import numpy
 import numpy.core.fromnumeric  as fromnumeric
-from numpy.testing import NumpyTest, NumpyTestCase
-from numpy.testing.utils import build_err_msg
+from scipy.testing import *
 
-import maskedarray.testutils
-from maskedarray.testutils import assert_equal, assert_array_equal, assert_equal_records
+from scipy.sandbox.maskedarray.testutils import assert_equal, assert_array_equal, assert_equal_records
 
-import maskedarray.core as MA
-import maskedarray.mrecords as MR
-from maskedarray.mrecords import addfield
+import scipy.sandbox.maskedarray.core as MA
+import scipy.sandbox.maskedarray.mrecords as MR
+from scipy.sandbox.maskedarray.mrecords import addfield
 
-from maskedarray.core import getmaskarray, nomask, masked_array
+from scipy.sandbox.maskedarray.core import getmaskarray, nomask, masked_array
 
-from timeseries import trecords
-from timeseries.trecords import TimeSeriesRecords, TimeSeries,\
+from scipy.sandbox.timeseries.trecords import \
+     TimeSeriesRecords, TimeSeries,\
     fromarrays, fromtextfile, fromrecords, \
     date_array, time_series
 
 
 #..............................................................................
-class TestMRecords(NumpyTestCase):
+class TestMRecords(TestCase):
     "Base test class for MaskedArrays."
     def __init__(self, *args, **kwds):
-        NumpyTestCase.__init__(self, *args, **kwds)
+        TestCase.__init__(self, *args, **kwds)
         self.setup()
 
     def setup(self):
@@ -186,4 +184,4 @@
 ###############################################################################
 #------------------------------------------------------------------------------
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sandbox/timeseries/trecords.py
===================================================================
--- trunk/scipy/sandbox/timeseries/trecords.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/trecords.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -26,17 +26,17 @@
 from numpy.core.records import format_parser, recarray, record
 from numpy.core.records import fromarrays as recfromarrays
 
-import maskedarray as MA
+import scipy.sandbox.maskedarray as MA
 #MaskedArray = MA.MaskedArray
-from maskedarray.core import MaskedArray, MAError, default_fill_value, \
-    masked_print_option
-from maskedarray.core import masked, nomask, getmask, getmaskarray, make_mask,\
+from scipy.sandbox.maskedarray.core import MaskedArray, MAError, \
+     default_fill_value, masked_print_option, masked, nomask, \
+     getmask, getmaskarray, make_mask,\
     make_mask_none, mask_or, masked_array, filled
 
-import maskedarray.mrecords as MR
-from maskedarray.mrecords import _checknames, _guessvartypes, openfile,\
-    MaskedRecords
-from maskedarray.mrecords import fromrecords as mrecfromrecords
+import scipy.sandbox.maskedarray.mrecords as MR
+from scipy.sandbox.maskedarray.mrecords import _checknames, \
+     _guessvartypes, openfile, MaskedRecords, \
+     fromrecords as mrecfromrecords
 
 from tseries import TimeSeries, time_series, _getdatalength
 from dates import Date, DateArray, date_array

Modified: trunk/scipy/sandbox/timeseries/tseries.py
===================================================================
--- trunk/scipy/sandbox/timeseries/tseries.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sandbox/timeseries/tseries.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -25,8 +25,8 @@
 from numpy.core.records import recarray
 from numpy.core.records import fromarrays as recfromarrays
 
-import maskedarray
-from maskedarray import MaskedArray, MAError, masked, nomask, \
+import scipy.sandbox.maskedarray as maskedarray
+from scipy.sandbox.maskedarray import MaskedArray, MAError, masked, nomask, \
     filled, getmask, getmaskarray, hsplit, make_mask_none, mask_or, make_mask, \
     masked_array
     

Modified: trunk/scipy/setup.py
===================================================================
--- trunk/scipy/setup.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/setup.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -22,6 +22,7 @@
     config.add_subpackage('ndimage')
     config.add_subpackage('stsci')
     config.add_subpackage('weave')
+    config.add_subpackage('testing')
     config.make_svn_version_py()  # installs __svn_version__.py
     config.make_config_py()
     return config

Modified: trunk/scipy/signal/__init__.py
===================================================================
--- trunk/scipy/signal/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/signal/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -13,5 +13,5 @@
 from wavelets import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/signal/tests/test_signaltools.py
===================================================================
--- trunk/scipy/signal/tests/test_signaltools.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/signal/tests/test_signaltools.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,34 +1,34 @@
 #this program corresponds to special.py
 
-from numpy.testing import *
-set_package_path()
+from scipy.testing import *
+
 import scipy.signal as signal
-restore_path()
 
+
 from numpy import array, arange
 
-class TestConvolve(NumpyTestCase):
-    def check_basic(self):
+class TestConvolve(TestCase):
+    def test_basic(self):
         a = [3,4,5,6,5,4]
         b = [1,2,3]
         c = signal.convolve(a,b)
         assert_array_equal(c,array([3,10,22,28,32,32,23,12]))
 
-class TestMedFilt(NumpyTestCase):
-    def check_basic(self):
+class TestMedFilt(TestCase):
+    def test_basic(self):
         f = [[3,4,5],[2,3,4],[1,2,5]]
         d = signal.medfilt(f)
         assert_array_equal(d, [[0,3,0],[2,3,3],[0,2,0]])
 
-class TestWiener(NumpyTestCase):
-    def check_basic(self):
+class TestWiener(TestCase):
+    def test_basic(self):
         g = array([[5,6,4,3],[3,5,6,2],[2,3,5,6],[1,6,9,7]],'d')
         correct = array([[2.16374269,3.2222222222, 2.8888888889, 1.6666666667],[2.666666667, 4.33333333333, 4.44444444444, 2.8888888888],[2.222222222, 4.4444444444, 5.4444444444, 4.801066874837],[1.33333333333, 3.92735042735, 6.0712560386, 5.0404040404]])
         h = signal.wiener(g)
         assert_array_almost_equal(h,correct,decimal=6)
 
-class TestCSpline1DEval(NumpyTestCase):
-    def check_basic(self):
+class TestCSpline1DEval(TestCase):
+    def test_basic(self):
         y=array([1,2,3,4,3,2,1,2,3.0])
         x=arange(len(y))
         dx=x[1]-x[0]
@@ -40,10 +40,10 @@
         # make sure interpolated values are on knot points
         assert_array_almost_equal(y2[::10], y, decimal=5)
 
-class TestOrderFilt(NumpyTestCase):
-    def check_basic(self):
+class TestOrderFilt(TestCase):
+    def test_basic(self):
         assert_array_equal(signal.order_filter([1,2,3],[1,0,1],1),
                            [2,3,2])
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/signal/tests/test_wavelets.py
===================================================================
--- trunk/scipy/signal/tests/test_wavelets.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/signal/tests/test_wavelets.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,19 +1,18 @@
 import numpy as N
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
 from scipy.signal import wavelets
-restore_path()
 
-class TestWavelets(NumpyTestCase):
-    def check_qmf(self):
+
+class TestWavelets(TestCase):
+    def test_qmf(self):
         assert_array_equal(wavelets.qmf([1,1]),[1,-1])
 
-    def check_daub(self):
+    def test_daub(self):
         for i in xrange(1,15):
             assert_equal(len(wavelets.daub(i)),i*2)
 
-    def check_cascade(self):
+    def test_cascade(self):
         for J in xrange(1,7):
             for i in xrange(1,5):
                 lpcoef = wavelets.daub(i)
@@ -22,7 +21,7 @@
                 assert len(x) == len(phi) == len(psi)
                 assert_equal(len(x),(k-1)*2**J)
 
-    def check_morlet(self):
+    def test_morlet(self):
         x = wavelets.morlet(50,4.1,complete=True)
         y = wavelets.morlet(50,4.1,complete=False)
         assert_equal(len(x),len(y))
@@ -32,4 +31,4 @@
         assert_equal(x,y)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sparse/__init__.py
===================================================================
--- trunk/scipy/sparse/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sparse/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -15,5 +15,5 @@
 from spfuncs import *
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/sparse/tests/test_base.py
===================================================================
--- trunk/scipy/sparse/tests/test_base.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sparse/tests/test_base.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -8,9 +8,9 @@
 Build sparse:
   python setup.py build
 Run tests if scipy is installed:
-  python -c 'import scipy;scipy.sparse.test(<level>)'
+  python -c 'import scipy;scipy.sparse.test()'
 Run tests if sparse is not installed:
-  python tests/test_sparse.py [<level>]
+  python tests/test_sparse.py
 """
 
 import numpy
@@ -18,16 +18,16 @@
         asarray, vstack, ndarray, kron, transpose
 
 import random
-from numpy.testing import *
-set_package_path()
+from scipy.testing import *
+
 from scipy.sparse import csc_matrix, csr_matrix, dok_matrix, \
         coo_matrix, lil_matrix, dia_matrix, bsr_matrix, \
         extract_diagonal, speye, spkron, SparseEfficiencyWarning
 from scipy.sparse.sputils import supported_dtypes
 from scipy.linsolve import splu
-restore_path()
 
 
+
 #TODO test spmatrix( [[1,2],[3,4]] ) format
 #TODO check that invalid shape in constructor raises exception
 #TODO check that spmatrix( ... , copy=X ) is respected
@@ -41,11 +41,11 @@
         self.dat = matrix([[1,0,0,2],[3,0,1,0],[0,2,0,0]],'d')
         self.datsp = self.spmatrix(self.dat)
    
-    def check_repr(self):
+    def test_repr(self):
         """make sure __repr__ works"""
         repr(self.spmatrix)
 
-    def check_empty(self):
+    def test_empty(self):
         """Test manipulating empty matrices. Fails in SciPy SVN <= r1768
         """
         shape = (5, 5)
@@ -62,15 +62,15 @@
                 assert_equal(m.dtype,mytype)
                 assert_equal(m.A.dtype,mytype)
 
-    def check_abs(self):
+    def test_abs(self):
         A = matrix([[-1, 0, 17],[0, -5, 0],[1, -4, 0],[0,0,0]],'d')
         assert_equal(abs(A),abs(self.spmatrix(A)).todense())
 
-    def check_neg(self):
+    def test_neg(self):
         A = matrix([[-1, 0, 17],[0, -5, 0],[1, -4, 0],[0,0,0]],'d')
         assert_equal(-A,(-self.spmatrix(A)).todense())
 
-    def check_sum(self):
+    def test_sum(self):
         """Does the matrix's sum(,axis=0) method work?
         """
         assert_array_equal(self.dat.sum(), self.datsp.sum())
@@ -78,7 +78,7 @@
         assert_array_equal(self.dat.sum(axis=0), self.datsp.sum(axis=0))
         assert_array_equal(self.dat.sum(axis=1), self.datsp.sum(axis=1))
 
-    def check_mean(self):
+    def test_mean(self):
         """Does the matrix's mean(,axis=0) method work?
         """
         assert_array_equal(self.dat.mean(), self.datsp.mean())
@@ -86,13 +86,13 @@
         assert_array_equal(self.dat.mean(axis=0), self.datsp.mean(axis=0))
         assert_array_equal(self.dat.mean(axis=1), self.datsp.mean(axis=1))
 
-    def check_fromdense(self):
+    def test_fromdense(self):
         A = matrix([[1,0,0],[2,3,4],[0,5,0],[0,0,0]])
         assert_array_equal(self.spmatrix(A).todense(),A)
         assert_array_equal(self.spmatrix(A.A).todense(),A)
         assert_array_equal(self.spmatrix(A.tolist()).todense(),A)
 
-    def check_todense(self):
+    def test_todense(self):
         chk = self.datsp.todense()
         assert_array_equal(chk,self.dat)
         a = matrix([1.,2.,3.])
@@ -104,7 +104,7 @@
         check2 = self.datsp.todense() * b
         assert_array_equal(dense_dot_dense, check2)
 
-    def check_toarray(self):
+    def test_toarray(self):
         dat = asarray(self.dat)
         chk = self.datsp.toarray()
         assert_array_equal(chk, dat)
@@ -118,36 +118,36 @@
         assert_array_equal(dense_dot_dense, check2)
 
 
-    def check_mul_scalar(self):
+    def test_mul_scalar(self):
         assert_array_equal(self.dat*2,(self.datsp*2).todense())
         assert_array_equal(self.dat*17.3,(self.datsp*17.3).todense())
     
-    def check_rmul_scalar(self):
+    def test_rmul_scalar(self):
         assert_array_equal(2*self.dat,(2*self.datsp).todense())
         assert_array_equal(17.3*self.dat,(17.3*self.datsp).todense())
 
-    def check_add(self):
+    def test_add(self):
         a = self.dat.copy()
         a[0,2] = 2.0
         b = self.datsp
         c = b + a
         assert_array_equal(c,[[2,0,2,4],[6,0,2,0],[0,4,0,0]])
 
-    def check_radd(self):
+    def test_radd(self):
         a = self.dat.copy()
         a[0,2] = 2.0
         b = self.datsp
         c = a + b
         assert_array_equal(c,[[2,0,2,4],[6,0,2,0],[0,4,0,0]])
 
-    def check_sub(self):
+    def test_sub(self):
         assert_array_equal((self.datsp - self.datsp).todense(),[[0,0,0,0],[0,0,0,0],[0,0,0,0]])
 
         A = self.spmatrix(matrix([[1,0,0,4],[-1,0,0,0],[0,8,0,-5]],'d'))
         assert_array_equal((self.datsp - A).todense(),self.dat - A.todense())
         assert_array_equal((A - self.datsp).todense(),A.todense() - self.dat)
 
-    def check_rsub(self):
+    def test_rsub(self):
         assert_array_equal((self.dat - self.datsp),[[0,0,0,0],[0,0,0,0],[0,0,0,0]])
         assert_array_equal((self.datsp - self.dat),[[0,0,0,0],[0,0,0,0],[0,0,0,0]])
 
@@ -157,14 +157,14 @@
         assert_array_equal(A.todense() - self.datsp,A.todense() - self.dat)
         assert_array_equal(self.datsp - A.todense(),self.dat - A.todense())
 
-    def check_elmul(self):
+    def test_elmul(self):
         temp = self.dat.copy()
         temp[0,2] = 2.0
         temp = self.spmatrix(temp)
         c = temp.multiply(self.datsp)
         assert_array_equal(c.todense(),[[1,0,0,4],[9,0,1,0],[0,4,0,0]])
 
-    def check_eldiv(self):
+    def test_eldiv(self):
         expected = [[1,0,0,1],[1,0,1,0],[0,1,0,0]] 
         assert_array_equal((self.datsp / self.datsp).todense(),expected)
 
@@ -172,7 +172,7 @@
         res = matrix([[1,0,0,0.5],[-3,0,numpy.inf,0],[0,0.25,0,0]],'d')
         assert_array_equal((self.datsp / denom).todense(),res)
     
-    def check_pow(self):
+    def test_pow(self):
         A = matrix([[1,0,2,0],[0,3,4,0],[0,5,0,0],[0,6,7,8]])
         B = self.spmatrix( A )
 
@@ -188,13 +188,13 @@
         self.assertRaises( Exception, B.__pow__, 1 )
 
 
-    def check_rmatvec(self):
+    def test_rmatvec(self):
         M = self.spmatrix(matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]))
         assert_array_almost_equal([1,2,3,4]*M, dot([1,2,3,4], M.toarray()))
         row = matrix([[1,2,3,4]])
         assert_array_almost_equal(row*M, row*M.todense())
 
-    def check_matvec(self):
+    def test_matvec(self):
         M = self.spmatrix(matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]]))
         col = matrix([1,2,3]).T
         assert_array_almost_equal(M * col, M.todense() * col)
@@ -240,7 +240,7 @@
         # Currently M.matvec(asarray(col)) is rank-1, whereas M.matvec(col)
         # is rank-2.  Is this desirable?
 
-    def check_matmat_sparse(self):
+    def test_matmat_sparse(self):
         a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]])
         a2 = array([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]])
         b = matrix([[0,1],[1,0],[0,2]],'d')
@@ -291,7 +291,7 @@
         assert_array_almost_equal(B.todense(), A.todense() * A.T.todense())
         assert_array_almost_equal(B.todense(), A.todense() * A.todense().T)
 
-    def check_matmat_dense(self):
+    def test_matmat_dense(self):
         a = matrix([[3,0,0],[0,1,0],[2,0,3.0],[2,3,0]])
         asp = self.spmatrix(a)
 
@@ -304,7 +304,7 @@
             assert_equal( result.shape, (4,2) )
             assert_equal( result, dot(a,b) )
 
-    def check_formatconversions(self):
+    def test_formatconversions(self):
         A = spkron([[1,0,1],[0,1,1],[1,0,0]], [[1,1],[0,1]] )
         D = A.todense()
         A = self.spmatrix(A)
@@ -324,11 +324,11 @@
 
 
             
-    def check_todia(self):
+    def test_todia(self):
         #TODO, add and test .todia(maxdiags)
         pass
     
-    def check_tocompressedblock(self):
+    def test_tocompressedblock(self):
         x = array([[1,0,2,0],[0,0,0,0],[0,0,4,5]])
         y = array([[0,1,2],[3,0,5]])
         A = kron(x,y)
@@ -341,7 +341,7 @@
                     assert_equal( fn(blocksize=(X,Y)).todense(), A)
 
 
-    def check_transpose(self):
+    def test_transpose(self):
         a = self.datsp.transpose()
         b = self.dat.transpose()
         assert_array_equal(a.todense(), b)
@@ -350,7 +350,7 @@
         assert_array_equal( self.spmatrix((3,4)).T.todense(), zeros((4,3)) )
 
 
-    def check_add_dense(self):
+    def test_add_dense(self):
         """ Check whether adding a dense matrix to a sparse matrix works
         """
         sum1 = self.dat + self.datsp
@@ -358,7 +358,7 @@
         sum2 = self.datsp + self.dat
         assert_array_equal(sum2, 2*self.dat)
 
-    def check_sub_dense(self):
+    def test_sub_dense(self):
         """ Check whether adding a dense matrix to a sparse matrix works
         """
         sum1 = 3*self.dat - self.datsp
@@ -367,7 +367,7 @@
         assert_array_equal(sum2, 2*self.dat)
 
 
-    def check_copy(self):
+    def test_copy(self):
         """ Check whether the copy=True and copy=False keywords work
         """
         A = self.datsp
@@ -397,20 +397,20 @@
 
     # Eventually we'd like to allow matrix products between dense
     # and sparse matrices using the normal dot() function:
-    #def check_dense_dot_sparse(self):
+    #def test_dense_dot_sparse(self):
     #    a = array([1.,2.,3.])
     #    dense_dot_dense = dot(a, self.dat)
     #    dense_dot_sparse = dot(a, self.datsp)
     #    assert_array_equal(dense_dot_dense, dense_dot_sparse)
 
-    #def check_sparse_dot_dense(self):
+    #def test_sparse_dot_dense(self):
     #    b = array([1.,2.,3.,4.])
     #    dense_dot_dense = dot(self.dat, b)
     #    dense_dot_sparse = dot(self.datsp, b)
     #    assert_array_equal(dense_dot_dense, dense_dot_sparse)
 
 
-    def check_extract_diagonal(self):
+    def test_extract_diagonal(self):
         """
         Test extraction of main diagonal from sparse matrices
         """
@@ -425,7 +425,7 @@
 
 
 class _TestInplaceArithmetic:
-    def check_imul_scalar(self):
+    def test_imul_scalar(self):
         a = self.datsp.copy()
         a *= 2
         assert_array_equal(self.dat*2,a.todense())
@@ -434,7 +434,7 @@
         a *= 17.3
         assert_array_equal(self.dat*17.3,a.todense())
 
-    def check_idiv_scalar(self):
+    def test_idiv_scalar(self):
         a = self.datsp.copy()
         a /= 2
         assert_array_equal(self.dat/2,a.todense())
@@ -446,7 +446,7 @@
 
 class _TestMatvecOutput:
     """test using the matvec() output parameter"""
-    def check_matvec_output(self): 
+    def test_matvec_output(self): 
         #flat array
         x = array([1.25, -6.5, 0.125, -3.75],dtype='d')
         y = zeros(3,dtype='d')
@@ -484,7 +484,7 @@
         assert_equal((self.datsp*x).dtype,y.dtype)
 
 class _TestGetSet:
-    def check_setelement(self):
+    def test_setelement(self):
         import warnings
         warnings.simplefilter('ignore',SparseEfficiencyWarning)
         a = self.spmatrix((3,4))
@@ -495,14 +495,14 @@
         a[-1,-2] = 7
         assert_array_equal(a.todense(),[[0,3,0,8],[0,0,4,0],[2,0,7,0]])
 
-    def check_getelement(self):
+    def test_getelement(self):
         assert_equal(self.datsp[0,0],1)
         assert_equal(self.datsp[0,1],0)
         assert_equal(self.datsp[1,0],3)
         assert_equal(self.datsp[2,1],2)
 
 class _TestSolve:
-    def check_solve(self):
+    def test_solve(self):
         """ Test whether the lu_solve command segfaults, as reported by Nils
         Wagner for a 64-bit machine, 02 March 2005 (EJS)
         """
@@ -526,7 +526,7 @@
     """Tests horizontal slicing (e.g. [0, :]).  Tests for individual sparse
     matrix types that implement this should derive from this class.
     """
-    def check_get_horiz_slice(self):
+    def test_get_horiz_slice(self):
         """Test for new slice functionality (EJS)"""
         B = asmatrix(arange(50.).reshape(5,10))
         A = self.spmatrix(B)
@@ -560,7 +560,7 @@
     """Tests vertical slicing (e.g. [:, 0]).  Tests for individual sparse
     matrix types that implement this should derive from this class.
     """
-    def check_get_vert_slice(self):
+    def test_get_vert_slice(self):
         """Test for new slice functionality (EJS)"""
         B = asmatrix(arange(50.).reshape(5,10))
         A = self.spmatrix(B)
@@ -597,7 +597,7 @@
     individual sparse matrix types that implement this should derive from this
     class.
     """
-    def check_get_slices(self):
+    def test_get_slices(self):
         B = asmatrix(arange(50.).reshape(5,10))
         A = self.spmatrix(B)
         assert_array_equal(B[2:5,0:3], A[2:5,0:3].todense())
@@ -615,13 +615,13 @@
     that implement these features should derive from this class.
     """
     # This isn't supported by any matrix objects yet:
-    def check_sequence_indexing(self):
+    def test_sequence_indexing(self):
         B = asmatrix(arange(50.).reshape(5,10))
         A = self.spmatrix(B)
         assert_array_equal(B[(1,2),(3,4)], A[(1,2),(3,4)].todense())
         assert_array_equal(B[(1,2,3),(3,4,5)], A[(1,2,3),(3,4,5)].todense())
 
-    def check_fancy_indexing(self):
+    def test_fancy_indexing(self):
         """Test for new indexing functionality"""
         B = ones((5,10), float)
         A = dok_matrix(B)
@@ -659,7 +659,7 @@
         self.Asp = self.spmatrix(self.A)
         self.Bsp = self.spmatrix(self.B)
 
-    def check_astype(self):
+    def test_astype(self):
         self.arith_init()
 
         #check whether dtype and value is preserved in conversion
@@ -674,7 +674,7 @@
             assert_array_equal(Asp.todense(),A)
             assert_array_equal(Bsp.todense(),B)
 
-    def check_add_sub(self):
+    def test_add_sub(self):
         self.arith_init()
 
         #basic tests
@@ -707,7 +707,7 @@
                 assert_array_equal(A - Bsp,D1)          #check dense - sparse
 
 
-    def check_mu(self):
+    def test_mu(self):
         self.arith_init()
 
         #basic tests
@@ -731,10 +731,10 @@
 class TestCSR(_TestCommon, _TestGetSet, _TestSolve,
         _TestInplaceArithmetic, _TestArithmetic, _TestMatvecOutput,
         _TestHorizSlicing, _TestVertSlicing, _TestBothSlicing,
-        NumpyTestCase):
+        TestCase):
     spmatrix = csr_matrix
 
-    def check_constructor1(self):
+    def test_constructor1(self):
         b = matrix([[0,4,0],
                    [3,0,0],
                    [0,2,0]],'d')
@@ -746,7 +746,7 @@
         assert_equal(bsp.getformat(),'csr')
         assert_array_equal(bsp.todense(),b)
 
-    def check_constructor2(self):
+    def test_constructor2(self):
         b = zeros((6,6),'d')
         b[3,4] = 5
         bsp = csr_matrix(b)
@@ -755,7 +755,7 @@
         assert_array_equal(bsp.indptr,[0,0,0,0,1,1,1])
         assert_array_almost_equal(bsp.todense(),b)
 
-    def check_constructor3(self):
+    def test_constructor3(self):
         b = matrix([[1,0],
                    [0,2],
                    [3,0]],'d')
@@ -766,7 +766,7 @@
         assert_array_almost_equal(bsp.todense(),b)
 
 ### currently disabled
-##    def check_constructor4(self):
+##    def test_constructor4(self):
 ##        """try using int64 indices"""
 ##        data = arange( 6 ) + 1
 ##        col = array( [1, 2, 1, 0, 0, 2], dtype='int64' )
@@ -782,7 +782,7 @@
 ##        assert_equal(a.indices.dtype,numpy.dtype('int64'))
 ##        assert_array_equal(a.todense(),b)
 
-    def check_constructor4(self):
+    def test_constructor4(self):
         """using (data, ij) format"""
         row  = numpy.array([2, 3, 1, 3, 0, 1, 3, 0, 2, 1, 2])
         col  = numpy.array([0, 1, 0, 0, 1, 1, 2, 2, 2, 2, 1])
@@ -793,7 +793,7 @@
         csr = csr_matrix((data,ij),(4,3))
         assert_array_equal(arange(12).reshape(4,3),csr.todense())
 
-    def check_constructor5(self):
+    def test_constructor5(self):
         """infer dimensions from arrays"""
         indptr  = array([0,1,3,3])
         indices = array([0,5,1,2])
@@ -802,7 +802,7 @@
         assert_array_equal(csr.shape,(3,6))
     
 
-    def check_sort_indices(self):
+    def test_sort_indices(self):
         data    = arange( 5 )
         indices = array( [7, 2, 1, 5, 4] )
         indptr  = array( [0, 3, 5] )
@@ -812,7 +812,7 @@
         assert_array_equal(asp.indices,[1, 2, 7, 4, 5])
         assert_array_equal(asp.todense(),bsp.todense())
 
-    def check_eliminate_zeros(self):
+    def test_eliminate_zeros(self):
         data    = array( [1, 0, 0, 0, 2, 0, 3, 0] )
         indices = array( [1, 2, 3, 4, 5, 6, 7, 8] )
         indptr  = array( [0, 3, 8] )
@@ -823,7 +823,7 @@
         assert_array_equal(asp.data,[1, 2, 3])
         assert_array_equal(asp.todense(),bsp.todense())
 
-    def check_get_submatrix(self):
+    def test_get_submatrix(self):
         a = csr_matrix( array([[1,2,3,4],[1,2,3,5],[0,2,0,1]]) )
         i0 = slice( 0, 2 )
         i1 = ( 1, 3 )
@@ -839,10 +839,10 @@
 class TestCSC(_TestCommon, _TestGetSet, _TestSolve,
         _TestInplaceArithmetic, _TestArithmetic, _TestMatvecOutput,
         _TestHorizSlicing, _TestVertSlicing, _TestBothSlicing,
-        NumpyTestCase):
+        TestCase):
     spmatrix = csc_matrix
 
-    def check_constructor1(self):
+    def test_constructor1(self):
         b = matrix([[1,0,0,0],[0,0,1,0],[0,2,0,3]],'d')
         bsp = csc_matrix(b)
         assert_array_almost_equal(bsp.data,[1,2,1,3])
@@ -852,7 +852,7 @@
         assert_equal(bsp.shape,b.shape)
         assert_equal(bsp.getformat(),'csc')
 
-    def check_constructor2(self):
+    def test_constructor2(self):
         b = zeros((6,6),'d')
         b[2,4] = 5
         bsp = csc_matrix(b)
@@ -860,14 +860,14 @@
         assert_array_equal(bsp.indices,[2])
         assert_array_equal(bsp.indptr,[0,0,0,0,0,1,1])
 
-    def check_constructor3(self):
+    def test_constructor3(self):
         b = matrix([[1,0],[0,0],[0,2]],'d')
         bsp = csc_matrix(b)
         assert_array_almost_equal(bsp.data,[1,2])
         assert_array_equal(bsp.indices,[0,2])
         assert_array_equal(bsp.indptr,[0,1,2])
 
-    def check_constructor4(self):
+    def test_constructor4(self):
         """using (data, ij) format"""
         row  = numpy.array([2, 3, 1, 3, 0, 1, 3, 0, 2, 1, 2])
         col  = numpy.array([0, 1, 0, 0, 1, 1, 2, 2, 2, 2, 1])
@@ -878,7 +878,7 @@
         csc = csc_matrix((data,ij),(4,3))
         assert_array_equal(arange(12).reshape(4,3),csc.todense())
 
-    def check_constructor5(self):
+    def test_constructor5(self):
         """infer dimensions from arrays"""
         indptr  = array([0,1,3,3])
         indices = array([0,5,1,2])
@@ -886,7 +886,7 @@
         csc = csc_matrix((data, indices, indptr))
         assert_array_equal(csc.shape,(6,3))
     
-    def check_eliminate_zeros(self):
+    def test_eliminate_zeros(self):
         data    = array( [1, 0, 0, 0, 2, 0, 3, 0] )
         indices = array( [1, 2, 3, 4, 5, 6, 7, 8] )
         indptr  = array( [0, 3, 8] )
@@ -897,7 +897,7 @@
         assert_array_equal(asp.data,[1, 2, 3])
         assert_array_equal(asp.todense(),bsp.todense())
     
-    def check_sort_indices(self):
+    def test_sort_indices(self):
         data = arange( 5 )
         row = array( [7, 2, 1, 5, 4] )
         ptr = [0, 3, 5]
@@ -907,7 +907,7 @@
         assert_array_equal(asp.indices,[1, 2, 7, 4, 5])
         assert_array_equal(asp.todense(),bsp.todense())
 
-    def check_get_submatrix(self):
+    def test_get_submatrix(self):
         a = csc_matrix( array([[1,2,3,4],[1,2,3,5],[0,2,0,1]]) )
         i0 = slice( 0, 2 )
         i1 = ( 1, 3 )
@@ -920,10 +920,10 @@
         assert_equal(b.shape, (2,2))
         assert_equal( ab, aa[i0,i1[0]:i1[1]] )
 
-class TestDOK(_TestCommon, _TestGetSet, _TestSolve, NumpyTestCase):
+class TestDOK(_TestCommon, _TestGetSet, _TestSolve, TestCase):
     spmatrix = dok_matrix
 
-    def check_mult(self):
+    def test_mult(self):
         A = dok_matrix((10,10))
         A[0,3] = 10
         A[5,6] = 20
@@ -931,7 +931,7 @@
         E = A*A.H
         assert_array_equal(D.A, E.A)
 
-    def check_add(self):
+    def test_add(self):
         A = dok_matrix((3,2))
         A[0,1] = -10
         A[2,0] = 20
@@ -939,7 +939,7 @@
         B = matrix([[10, 0], [10, 10], [30, 10]])
         assert_array_equal(A.todense(), B)
 
-    def check_convert(self):
+    def test_convert(self):
         """Test provided by Andrew Straw.  Fails in SciPy <= r1477.
         """
         (m, n) = (6, 7)
@@ -971,7 +971,7 @@
         csr=b.tocsr()
         assert_array_equal( csr.toarray()[m-1,:], zeros(n,))
 
-    def check_set_slice(self):
+    def test_set_slice(self):
         """Test for slice functionality (EJS)"""
         A = dok_matrix((5,10))
         B = zeros((5,10), float)
@@ -1030,7 +1030,7 @@
 class TestLIL( _TestCommon, _TestHorizSlicing, _TestVertSlicing, 
         _TestBothSlicing, _TestGetSet, _TestSolve,
         _TestArithmetic, _TestInplaceArithmetic,
-        NumpyTestCase):
+        TestCase):
     spmatrix = lil_matrix
 
     B = lil_matrix((4,3))
@@ -1039,7 +1039,7 @@
     B[2,1] = 3
     B[3,0] = 10
 
-    def check_dot(self):
+    def test_dot(self):
         A = matrix(zeros((10,10)))
         A[0,3] = 10
         A[5,6] = 20
@@ -1050,7 +1050,7 @@
         assert_array_equal(A * A.T, (B * B.T).todense())
         assert_array_equal(A * A.H, (B * B.H).todense())
 
-    def check_scalar_mul(self):
+    def test_scalar_mul(self):
         x = lil_matrix((3,3))
         x[0,0] = 2
 
@@ -1060,7 +1060,7 @@
         x = x*0
         assert_equal(x[0,0],0)
 
-    def check_reshape(self):
+    def test_reshape(self):
         x = lil_matrix((4,3))
         x[0,0] = 1
         x[2,1] = 3
@@ -1071,7 +1071,7 @@
             assert_array_equal(x.reshape(s).todense(),
                                x.todense().reshape(s))
 
-    def check_lil_lil_assignment(self):
+    def test_lil_lil_assignment(self):
         """ Tests whether a row of one lil_matrix can be assigned to
         another.
         """
@@ -1099,7 +1099,7 @@
         return [(self.tst_inplace_op,op,B,other,result)
                 for op,(other,result) in data.iteritems()]
 
-    def check_lil_slice_assignment(self):
+    def test_lil_slice_assignment(self):
         B = lil_matrix((4,3))
         B[0,0] = 5
         B[1,2] = 3
@@ -1117,7 +1117,7 @@
         B[:2,:2] = csc_matrix(array(block))
         assert_array_equal(B.todense()[:2,:2],block)
 
-    def check_lil_sequence_assignement(self):
+    def test_lil_sequence_assignement(self):
         A = lil_matrix((4,3))
         B = speye(3,4,format='lil')
 
@@ -1130,13 +1130,13 @@
         A[2,i2] = B[i2,2]
         assert_array_equal(A.todense(),B.T.todense())
 
-    def check_lil_iteration(self):
+    def test_lil_iteration(self):
         row_data = [[1,2,3],[4,5,6]]
         B = lil_matrix(array(row_data))
         for r,row in enumerate(B):
             assert_array_equal(row.todense(),array(row_data[r],ndmin=2))
 
-    def check_lil_from_csr(self):
+    def test_lil_from_csr(self):
         """ Tests whether a lil_matrix can be constructed from a
         csr_matrix.
         """
@@ -1150,7 +1150,7 @@
         D = lil_matrix(C)
         assert_array_equal(C.A, D.A)
 
-    def check_point_wise_multiply(self):
+    def test_point_wise_multiply(self):
         l = lil_matrix((4,3))
         l[0,0] = 1
         l[1,1] = 2
@@ -1175,9 +1175,9 @@
 
 
 
-class TestCOO(_TestCommon, NumpyTestCase):
+class TestCOO(_TestCommon, TestCase):
     spmatrix = coo_matrix
-    def check_constructor1(self):
+    def test_constructor1(self):
         """unsorted triplet format"""
         row  = numpy.array([2, 3, 1, 3, 0, 1, 3, 0, 2, 1, 2])
         col  = numpy.array([0, 1, 0, 0, 1, 1, 2, 2, 2, 2, 1])
@@ -1188,7 +1188,7 @@
 
         assert_array_equal(arange(12).reshape(4,3),coo.todense())
 
-    def check_constructor2(self):
+    def test_constructor2(self):
         """unsorted triplet format with duplicates (which are summed)"""
         row  = numpy.array([0,1,2,2,2,2,0,0,2,2])
         col  = numpy.array([0,2,0,2,1,1,1,0,0,2])
@@ -1199,7 +1199,7 @@
 
         assert_array_equal(mat,coo.todense())
 
-    def check_constructor3(self):
+    def test_constructor3(self):
         """empty matrix"""
         coo = coo_matrix( (4,3) )
 
@@ -1209,7 +1209,7 @@
         assert_array_equal(coo.data,[])
         assert_array_equal(coo.todense(),zeros((4,3)))
 
-    def check_constructor4(self):
+    def test_constructor4(self):
         """from dense matrix"""
         mat = numpy.array([[0,1,0,0],
                            [7,0,3,0],
@@ -1223,19 +1223,19 @@
         assert_array_equal(coo.todense(),mat.reshape(1,-1))
 
 
-class TestDIA(_TestCommon, _TestArithmetic, NumpyTestCase):
+class TestDIA(_TestCommon, _TestArithmetic, TestCase):
     spmatrix = dia_matrix
 
-    def check_constructor1(self):
+    def test_constructor1(self):
         pass
         #TODO add test
     
 
 class TestBSR(_TestCommon, _TestArithmetic, _TestInplaceArithmetic,
-        _TestMatvecOutput, NumpyTestCase):
+        _TestMatvecOutput, TestCase):
     spmatrix = bsr_matrix
 
-    def check_constructor1(self):
+    def test_constructor1(self):
         """check native BSR format constructor"""
         indptr  = array([0,2,2,4]) 
         indices = array([0,2,2,3])
@@ -1258,7 +1258,7 @@
         Asp = bsr_matrix((data,indices,indptr))
         assert_equal(Asp.todense(),A)
 
-    def check_constructor2(self):
+    def test_constructor2(self):
         """construct from dense"""
    
         #test zero mats
@@ -1282,7 +1282,7 @@
         A = kron( [[1,0,2,0],[0,1,0,0],[0,0,0,0]], [[0,1,2],[3,0,5]] )
         assert_equal(bsr_matrix(A,blocksize=(2,3)).todense(),A)
         
-    def check_eliminate_zeros(self):
+    def test_eliminate_zeros(self):
         data = kron([1, 0, 0, 0, 2, 0, 3, 0], [[1,1],[1,1]]).T
         data = data.reshape(-1,2,2)
         indices = array( [1, 2, 3, 4, 5, 6, 7, 8] )
@@ -1295,4 +1295,4 @@
 
                 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/sparse/tests/test_construct.py
===================================================================
--- trunk/scipy/sparse/tests/test_construct.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sparse/tests/test_construct.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,18 +1,17 @@
 """test sparse matrix construction functions"""
 
 from numpy import array, kron
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
+
 from scipy.sparse import csr_matrix, \
      spidentity, speye, spkron, spdiags, \
      lil_eye, lil_diags
-restore_path()
 
 #TODO check whether format=XXX is respected
 
-class TestConstructUtils(NumpyTestCase):
-    def check_spdiags(self):
+class TestConstructUtils(TestCase):
+    def test_spdiags(self):
         diags1 = array( [[ 1, 2, 3, 4, 5]] )
         diags2 = array( [[ 1, 2, 3, 4, 5],
                          [ 6, 7, 8, 9,10]] )
@@ -60,12 +59,12 @@
             assert_equal( spdiags(d,o,m,n).todense(), result )
         
            
-    def check_identity(self):
+    def test_identity(self):
         a = spidentity(3)
         b = array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype='d')
         assert_array_equal(a.toarray(), b)
 
-    def check_eye(self):
+    def test_eye(self):
         a = speye(2, 3 )
         b = array([[1, 0, 0], [0, 1, 0]], dtype='d')
         assert_array_equal(a.toarray(), b)
@@ -78,7 +77,7 @@
         b = array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype='d')
         assert_array_equal(a.toarray(), b)
 
-    def check_spkron(self):
+    def test_spkron(self):
         cases = []
 
         cases.append(array([[ 0]]))
@@ -102,7 +101,7 @@
 
                 assert_array_equal(result,expected)
 
-    def check_lil_diags(self):
+    def test_lil_diags(self):
         assert_array_equal(lil_diags([[1,2,3],[4,5],[6]],
                                      [0,1,2],(3,3)).todense(),
                            [[1,4,6],
@@ -134,5 +133,5 @@
                             [6,5,0]])
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()
 

Modified: trunk/scipy/sparse/tests/test_sparse.py
===================================================================
--- trunk/scipy/sparse/tests/test_sparse.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sparse/tests/test_sparse.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,14 +4,14 @@
 from numpy import ones, array, asarray, empty
 
 import random
-from numpy.testing import *
-set_package_path()
+from scipy.testing import *
+
 from scipy.sparse import csc_matrix, csr_matrix, dok_matrix, \
         coo_matrix, lil_matrix, dia_matrix, spidentity, spdiags, \
         spkron
 from scipy.linsolve import splu
-restore_path()
 
+
 def random_sparse(m,n,nnz_per_row):
     rows = numpy.arange(m).repeat(nnz_per_row)
     cols = numpy.random.random_integers(low=0,high=n-1,size=nnz_per_row*m)
@@ -43,10 +43,11 @@
     return dia_matrix((diags,offsets),shape=(N**2,N**2)).asformat(format)
 
 import time
-class TestSparseTools(NumpyTestCase):
+class TestSparseTools(TestCase):
     """Simple benchmarks for sparse matrix module"""
 
-    def test_arithmetic(self,level=5):
+    @dec.bench
+    def test_arithmetic(self):
         matrices = []
         #matrices.append( ('A','Identity', spidentity(500**2,format='csr')) )
         matrices.append( ('A','Poisson5pt', poisson2d(500,format='csr'))  )
@@ -93,8 +94,8 @@
                     print fmt % (format,operation,msec_per_it)
 
   
-
-    def bench_sort(self,level=5):
+    @dec.bench
+    def test_sort(self):
         """sort CSR column indices"""
         matrices = []
         matrices.append( ('Rand10',  1e4,  10) )
@@ -127,8 +128,8 @@
 
             print fmt % (A.format,name,shape,A.nnz,1e3*(end-start)/float(iter) )
 
-
-    def bench_matvec(self,level=4):
+    @dec.bench
+    def test_matvec(self):
         matrices = []
         matrices.append(('Identity',   spidentity(10**4,format='dia')))
         matrices.append(('Identity',   spidentity(10**4,format='csr')))
@@ -175,7 +176,8 @@
 
             print fmt % (A.format,name,shape,A.nnz,MFLOPs)
             
-    def bench_construction(self,level=5):
+    @dec.bench
+    def test_construction(self):
         """build matrices by inserting single values"""
         matrices = []
         matrices.append( ('Empty',csr_matrix((10000,10000))) )
@@ -210,8 +212,8 @@
 
                 print fmt % (format,name,shape,A.nnz,(end-start)/float(iter))
 
-
-    def bench_conversion(self,level=5):
+    @dec.bench
+    def test_conversion(self):
         A = poisson2d(100)
 
         formats = ['csr','csc','coo','lil','dok']
@@ -252,8 +254,8 @@
             print output
 
 
-class TestLarge(NumpyTestCase):
-    def check_large(self):
+class TestLarge(TestCase):
+    def test_large(self):
         # Create a 100x100 matrix with 100 non-zero elements
         # and play around with it
         #TODO move this out of Common since it doesn't use spmatrix
@@ -280,5 +282,5 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()
 

Modified: trunk/scipy/sparse/tests/test_spfuncs.py
===================================================================
--- trunk/scipy/sparse/tests/test_spfuncs.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sparse/tests/test_spfuncs.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,15 +1,13 @@
 from numpy import array, kron, diag, matrix
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
 from scipy.sparse.spfuncs import *
 from scipy.sparse import csr_matrix, csc_matrix, bsr_matrix
 from scipy.sparse.sparsetools import csr_scale_rows, csr_scale_columns, \
         bsr_scale_rows, bsr_scale_columns
-restore_path()
 
-class TestSparseFunctions(NumpyTestCase):
-    def check_scale_rows_and_cols(self):
+class TestSparseFunctions(TestCase):
+    def test_scale_rows_and_cols(self):
         D = matrix([[1,0,0,2,3],
                     [0,4,0,5,0],
                     [0,0,6,7,0]])
@@ -51,7 +49,7 @@
 
 
 
-    def check_extract_diagonal(self):
+    def test_extract_diagonal(self):
         mats = []
         mats.append( [[1,0,2]] )
         mats.append( [[1],[0],[2]] )
@@ -81,8 +79,7 @@
                         assert_equal(result,expected)
             
 
-    def check_estimate_blocksize(self):
-
+    def test_estimate_blocksize(self):
         mats = []
         mats.append( [[0,1],[1,0]] )
         mats.append( [[1,1,0],[0,0,1],[1,0,1]] )
@@ -103,7 +100,7 @@
                 assert(r >= B.shape[0])
                 assert(c >= B.shape[1])
 
-    def check_count_blocks(self):
+    def test_count_blocks(self):
         def gold(A,bs):
             R,C = bs
             I,J = A.nonzero()
@@ -132,7 +129,6 @@
         assert_equal(count_blocks(Y,(1,2)),gold(X,(1,2)))
 
 
-
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittests.main()
 

Modified: trunk/scipy/sparse/tests/test_sputils.py
===================================================================
--- trunk/scipy/sparse/tests/test_sputils.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/sparse/tests/test_sputils.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,29 +1,25 @@
 """unit tests for sparse utility functions"""
 
 import numpy as np
-from numpy.testing import *
-
-set_package_path()
+from scipy.testing import *
 from scipy.sparse.sputils import *
-restore_path()
 
 
+class TestSparseUtils(TestCase):
 
-class TestSparseUtils(NumpyTestCase):
-
-    def check_upcast(self):
+    def test_upcast(self):
         assert_equal(upcast('intc'),np.intc)
         assert_equal(upcast('int32','float32'),np.float64)
         assert_equal(upcast('bool',complex,float),np.complex128)
         assert_equal(upcast('i','d'),np.float64)
 
-    def check_getdtype(self):
+    def test_getdtype(self):
         A = np.array([1],dtype='int8')
 
         assert_equal(getdtype(None,default=float),np.float)
         assert_equal(getdtype(None,a=A),np.int8)
 
-    def check_isscalarlike(self):
+    def test_isscalarlike(self):
         assert_equal(isscalarlike(3.0),True)
         assert_equal(isscalarlike(-4),True)
         assert_equal(isscalarlike(2.5),True)
@@ -36,7 +32,7 @@
         assert_equal(isscalarlike( (1,) ), False)
         assert_equal(isscalarlike( (1,2) ), False)
 
-    def check_isintlike(self):
+    def test_isintlike(self):
         assert_equal(isintlike(3.0),True)
         assert_equal(isintlike(-4),True)
         assert_equal(isintlike(np.array(3)),True)
@@ -47,7 +43,7 @@
         assert_equal(isintlike( (1,) ), False)
         assert_equal(isintlike( (1,2) ), False)
 
-    def check_isshape(self):
+    def test_isshape(self):
         assert_equal(isshape( (1,2) ),True)
         assert_equal(isshape( (5,2) ),True)
 
@@ -56,7 +52,7 @@
         assert_equal(isshape( (0,4) ),False)
         assert_equal(isshape( (2,2,2) ),False)
 
-    def check_issequence(self):
+    def test_issequence(self):
         assert_equal(issequence( (1,) ),True)
         assert_equal(issequence( (1,2,3) ),True)
         assert_equal(issequence( [1] ),True)
@@ -66,11 +62,11 @@
         assert_equal(issequence( np.array([[1],[2],[3]]) ),False)
         assert_equal(issequence( 3 ),False)
 
-    def check_isdense(self):
+    def test_isdense(self):
         assert_equal(isdense( np.array([1]) ),True)
         assert_equal(isdense( np.matrix([1]) ),True)
                 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()
 
 

Modified: trunk/scipy/special/__init__.py
===================================================================
--- trunk/scipy/special/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/special/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -19,5 +19,5 @@
 register_func('i0',i0)
 del register_func
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/special/tests/test_basic.py
===================================================================
--- trunk/scipy/special/tests/test_basic.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/special/tests/test_basic.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -32,377 +32,377 @@
 #8   test_sh_jacobi
 #8   test_sh_legendre
 
-from numpy import *
+from numpy import dot
 
-from numpy.testing import *
-set_package_path()
+from scipy.testing import *
+
 from scipy.special import *
 import scipy.special._cephes as cephes
-restore_path()
 
-class TestCephes(NumpyTestCase):
-    def check_airy(self):
+
+class TestCephes(TestCase):
+    def test_airy(self):
         cephes.airy(0)
-    def check_airye(self):
+    def test_airye(self):
         cephes.airye(0)
-    def check_bdtr(self):
+    def test_bdtr(self):
         assert_equal(cephes.bdtr(1,1,0.5),1.0)
-    def check_bdtri(self):
+    def test_bdtri(self):
         assert_equal(cephes.bdtri(1,3,0.5),0.5)
-    def check_bdtrc(self):
+    def test_bdtrc(self):
         assert_equal(cephes.bdtrc(1,3,0.5),0.5)
-    def check_bdtrin(self):
+    def test_bdtrin(self):
         assert_equal(cephes.bdtrin(1,0,1),5.0)
-    def check_bdtrik(self):
+    def test_bdtrik(self):
         cephes.bdtrik(1,3,0.5)
 
-    def check_bei(self):
+    def test_bei(self):
         assert_equal(cephes.bei(0),0.0)
-    def check_beip(self):
+    def test_beip(self):
         assert_equal(cephes.beip(0),0.0)
-    def check_ber(self):
+    def test_ber(self):
         assert_equal(cephes.ber(0),1.0)
-    def check_berp(self):
+    def test_berp(self):
         assert_equal(cephes.berp(0),0.0)
 
-    def check_besselpoly(self):
+    def test_besselpoly(self):
         assert_equal(cephes.besselpoly(0,0,0),1.0)
 
-    def check_beta(self):
+    def test_beta(self):
         assert_equal(cephes.beta(1,1),1.0)
-    def check_betainc(self):
+    def test_betainc(self):
         assert_equal(cephes.betainc(1,1,1),1.0)
-    def check_betaln(self):
+    def test_betaln(self):
         assert_equal(cephes.betaln(1,1),0.0)
-    def check_betaincinv(self):
+    def test_betaincinv(self):
         assert_equal(cephes.betaincinv(1,1,1),1.0)
 
-    def check_btdtr(self):
+    def test_btdtr(self):
         assert_equal(cephes.btdtr(1,1,1),1.0)
-    def check_btdtri(self):
+    def test_btdtri(self):
         assert_equal(cephes.btdtri(1,1,1),1.0)
-    def check_btdtria(self):
+    def test_btdtria(self):
         assert_equal(cephes.btdtria(1,1,1),5.0)
-    def check_btdtrib(self):
+    def test_btdtrib(self):
         assert_equal(cephes.btdtrib(1,1,1),5.0)
 
-    def check_cbrt(self):
+    def test_cbrt(self):
         assert_approx_equal(cephes.cbrt(1),1.0)
 
-    def check_chdtr(self):
+    def test_chdtr(self):
         assert_equal(cephes.chdtr(1,0),0.0)
-    def check_chdtrc(self):
+    def test_chdtrc(self):
         assert_equal(cephes.chdtrc(1,0),1.0)
-    def check_chdtri(self):
+    def test_chdtri(self):
         assert_equal(cephes.chdtri(1,1),0.0)
-    def check_chdtriv(self):
+    def test_chdtriv(self):
         assert_equal(cephes.chdtriv(0,0),5.0)
 
-    def check_chndtr(self):
+    def test_chndtr(self):
         assert_equal(cephes.chndtr(0,1,0),0.0)
-    def check_chndtridf(self):
+    def test_chndtridf(self):
         assert_equal(cephes.chndtridf(0,0,1),5.0)
-    def check_chndtrinc(self):
+    def test_chndtrinc(self):
         assert_equal(cephes.chndtrinc(0,1,0),5.0)
-    def check_chndtrix(self):
+    def test_chndtrix(self):
         assert_equal(cephes.chndtrix(0,1,0),0.0)
 
-    def check_cosdg(self):
+    def test_cosdg(self):
         assert_equal(cephes.cosdg(0),1.0)
-    def check_cosm1(self):
+    def test_cosm1(self):
         assert_equal(cephes.cosm1(0),0.0)
-    def check_cotdg(self):
+    def test_cotdg(self):
         assert_almost_equal(cephes.cotdg(45),1.0)
 
-    def check_dawsn(self):
+    def test_dawsn(self):
         assert_equal(cephes.dawsn(0),0.0)
 
-    def check_ellipe(self):
+    def test_ellipe(self):
         assert_equal(cephes.ellipe(1),1.0)
-    def check_ellipeinc(self):
+    def test_ellipeinc(self):
         assert_equal(cephes.ellipeinc(0,1),0.0)
-    def check_ellipj(self):
+    def test_ellipj(self):
         cephes.ellipj(0,1)
-    def check_ellipk(self):
+    def test_ellipk(self):
         cephes.ellipk(0)#==pi/2
-    def check_ellipkinc(self):
+    def test_ellipkinc(self):
         assert_equal(cephes.ellipkinc(0,0),0.0)
 
-    def check_erf(self):
+    def test_erf(self):
         assert_equal(cephes.erf(0),0.0)
-    def check_erfc(self):
+    def test_erfc(self):
         assert_equal(cephes.erfc(0),1.0)
 
-    def check_exp1(self):
+    def test_exp1(self):
         cephes.exp1(1)
-    def check_expi(self):
+    def test_expi(self):
         cephes.expi(1)
-    def check_expn(self):
+    def test_expn(self):
         cephes.expn(1,1)
 
-    def check_exp10(self):
+    def test_exp10(self):
         assert_approx_equal(cephes.exp10(2),100.0)
-    def check_exp2(self):
+    def test_exp2(self):
         assert_equal(cephes.exp2(2),4.0)
-    def check_expm1(self):
+    def test_expm1(self):
         assert_equal(cephes.expm1(0),0.0)
 
-    def check_fdtr(self):
+    def test_fdtr(self):
         assert_equal(cephes.fdtr(1,1,0),0.0)
-    def check_fdtrc(self):
+    def test_fdtrc(self):
         assert_equal(cephes.fdtrc(1,1,0),1.0)
-    def check_fdtri(self):
+    def test_fdtri(self):
         cephes.fdtri(1,1,0.5)
-    def check_fdtridfd(self):
+    def test_fdtridfd(self):
         assert_equal(cephes.fdtridfd(1,0,0),5.0)
 
-    def check_fresnel(self):
+    def test_fresnel(self):
         assert_equal(cephes.fresnel(0),(0.0,0.0))
 
-    def check_gamma(self):
+    def test_gamma(self):
         assert_equal(cephes.gamma(5),24.0)
-    def check_gammainc(self):
+    def test_gammainc(self):
         assert_equal(cephes.gammainc(5,0),0.0)
-    def check_gammaincc(self):
+    def test_gammaincc(self):
         assert_equal(cephes.gammaincc(5,0),1.0)
-    def check_gammainccinv(self):
+    def test_gammainccinv(self):
         assert_equal(cephes.gammainccinv(5,1),0.0)
-    def check_gammaln(self):
+    def test_gammaln(self):
         cephes.gammaln(10)
 
-    def check_gdtr(self):
+    def test_gdtr(self):
         assert_equal(cephes.gdtr(1,1,0),0.0)
-    def check_gdtrc(self):
+    def test_gdtrc(self):
         assert_equal(cephes.gdtrc(1,1,0),1.0)
-    def check_gdtria(self):
+    def test_gdtria(self):
         assert_equal(cephes.gdtria(0,1,1),0.0)
-    def check_gdtrib(self):
+    def test_gdtrib(self):
         cephes.gdtrib(1,0,1)
         #assert_equal(cephes.gdtrib(1,0,1),5.0)
-    def check_gdtrix(self):
+    def test_gdtrix(self):
         cephes.gdtrix(1,1,.1)
 
-    def check_hankel1(self):
+    def test_hankel1(self):
         cephes.hankel1(1,1)
-    def check_hankel1e(self):
+    def test_hankel1e(self):
         cephes.hankel1e(1,1)
-    def check_hankel2(self):
+    def test_hankel2(self):
         cephes.hankel2(1,1)
-    def check_hankel2e(self):
+    def test_hankel2e(self):
         cephes.hankel2e(1,1)
 
-    def check_hyp1f1(self):
+    def test_hyp1f1(self):
         assert_approx_equal(cephes.hyp1f1(1,1,1), exp(1.0))
         assert_approx_equal(cephes.hyp1f1(3,4,-6), 0.026056422099537251095)
         cephes.hyp1f1(1,1,1)
-    def check_hyp1f2(self):
+    def test_hyp1f2(self):
         cephes.hyp1f2(1,1,1,1)
-    def check_hyp2f0(self):
+    def test_hyp2f0(self):
         cephes.hyp2f0(1,1,1,1)
-    def check_hyp2f1(self):
+    def test_hyp2f1(self):
         assert_equal(cephes.hyp2f1(1,1,1,0),1.0)
-    def check_hyp3f0(self):
+    def test_hyp3f0(self):
         assert_equal(cephes.hyp3f0(1,1,1,0),(1.0,0.0))
-    def check_hyperu(self):
+    def test_hyperu(self):
         assert_equal(cephes.hyperu(0,1,1),1.0)
 
-    def check_i0(self):
+    def test_i0(self):
         assert_equal(cephes.i0(0),1.0)
-    def check_i0e(self):
+    def test_i0e(self):
         assert_equal(cephes.i0e(0),1.0)
-    def check_i1(self):
+    def test_i1(self):
         assert_equal(cephes.i1(0),0.0)
-    def check_i1e(self):
+    def test_i1e(self):
         assert_equal(cephes.i1e(0),0.0)
 
-    def check_it2i0k0(self):
+    def test_it2i0k0(self):
         cephes.it2i0k0(1)
-    def check_it2j0y0(self):
+    def test_it2j0y0(self):
         cephes.it2j0y0(1)
-    def check_it2struve0(self):
+    def test_it2struve0(self):
         cephes.it2struve0(1)
-    def check_itairy(self):
+    def test_itairy(self):
         cephes.itairy(1)
-    def check_iti0k0(self):
+    def test_iti0k0(self):
         assert_equal(cephes.iti0k0(0),(0.0,0.0))
-    def check_itj0y0(self):
+    def test_itj0y0(self):
         assert_equal(cephes.itj0y0(0),(0.0,0.0))
-    def check_itmodstruve0(self):
+    def test_itmodstruve0(self):
         assert_equal(cephes.itmodstruve0(0),0.0)
-    def check_itstruve0(self):
+    def test_itstruve0(self):
         assert_equal(cephes.itstruve0(0),0.0)
-    def check_iv(self):
+    def test_iv(self):
         assert_equal(cephes.iv(1,0),0.0)
     def _check_ive(self):
         assert_equal(cephes.ive(1,0),0.0)
 
-    def check_j0(self):
+    def test_j0(self):
         assert_equal(cephes.j0(0),1.0)
-    def check_j1(self):
+    def test_j1(self):
         assert_equal(cephes.j1(0),0.0)
-    def check_jn(self):
+    def test_jn(self):
         assert_equal(cephes.jn(0,0),1.0)
-    def check_jv(self):
+    def test_jv(self):
         assert_equal(cephes.jv(0,0),1.0)
     def _check_jve(self):
         assert_equal(cephes.jve(0,0),1.0)
 
-    def check_k0(self):
+    def test_k0(self):
         cephes.k0(2)
-    def check_k0e(self):
+    def test_k0e(self):
         cephes.k0e(2)
-    def check_k1(self):
+    def test_k1(self):
         cephes.k1(2)
-    def check_k1e(self):
+    def test_k1e(self):
         cephes.k1e(2)
-    def check_kei(self):
+    def test_kei(self):
         cephes.kei(2)
-    def check_keip(self):
+    def test_keip(self):
         assert_equal(cephes.keip(0),0.0)
-    def check_ker(self):
+    def test_ker(self):
         cephes.ker(2)
-    def check_kerp(self):
+    def test_kerp(self):
         cephes.kerp(2)
     def _check_kelvin(self):
         cephes.kelvin(2)
-    def check_kn(self):
+    def test_kn(self):
         cephes.kn(1,1)
 
-    def check_kolmogi(self):
+    def test_kolmogi(self):
         assert_equal(cephes.kolmogi(1),0.0)
-    def check_kolmogorov(self):
+    def test_kolmogorov(self):
         assert_equal(cephes.kolmogorov(0),1.0)
 
     def _check_kv(self):
         cephes.kv(1,1)
     def _check_kve(self):
         cephes.kve(1,1)
-    def check_log1p(self):
+    def test_log1p(self):
         assert_equal(cephes.log1p(0),0.0)
-    def check_lpmv(self):
+    def test_lpmv(self):
         assert_equal(cephes.lpmv(0,0,1),1.0)
 
-    def check_mathieu_a(self):
+    def test_mathieu_a(self):
         assert_equal(cephes.mathieu_a(1,0),1.0)
-    def check_mathieu_b(self):
+    def test_mathieu_b(self):
         assert_equal(cephes.mathieu_b(1,0),1.0)
-    def check_mathieu_cem(self):
+    def test_mathieu_cem(self):
         assert_equal(cephes.mathieu_cem(1,0,0),(1.0,0.0))
-    def check_mathieu_modcem1(self):
+    def test_mathieu_modcem1(self):
         assert_equal(cephes.mathieu_modcem1(1,0,0),(0.0,0.0))
-    def check_mathieu_modcem2(self):
+    def test_mathieu_modcem2(self):
         cephes.mathieu_modcem2(1,1,1)
-    def check_mathieu_sem(self):
+    def test_mathieu_sem(self):
         assert_equal(cephes.mathieu_sem(1,0,0),(0.0,1.0))
-    def check_mathieu_modsem1(self):
+    def test_mathieu_modsem1(self):
         assert_equal(cephes.mathieu_modsem1(1,0,0),(0.0,0.0))
-    def check_mathieu_modsem2(self):
+    def test_mathieu_modsem2(self):
         cephes.mathieu_modsem2(1,1,1)
 
-    def check_modfresnelm(self):
+    def test_modfresnelm(self):
         cephes.modfresnelm(0)
-    def check_modfresnelp(self):
+    def test_modfresnelp(self):
         cephes.modfresnelp(0)
     def _check_modstruve(self):
         assert_equal(cephes.modstruve(1,0),0.0)
 
-    def check_nbdtr(self):
+    def test_nbdtr(self):
         assert_equal(cephes.nbdtr(1,1,1),1.0)
-    def check_nbdtrc(self):
+    def test_nbdtrc(self):
         assert_equal(cephes.nbdtrc(1,1,1),0.0)
-    def check_nbdtri(self):
+    def test_nbdtri(self):
         assert_equal(cephes.nbdtri(1,1,1),1.0)
     def __check_nbdtrik(self):
         cephes.nbdtrik(1,.4,.5)
-    def check_nbdtrin(self):
+    def test_nbdtrin(self):
         assert_equal(cephes.nbdtrin(1,0,0),5.0)
 
-    def check_ncfdtr(self):
+    def test_ncfdtr(self):
         assert_equal(cephes.ncfdtr(1,1,1,0),0.0)
-    def check_ncfdtri(self):
+    def test_ncfdtri(self):
         assert_equal(cephes.ncfdtri(1,1,1,0),0.0)
-    def check_ncfdtridfd(self):
+    def test_ncfdtridfd(self):
         cephes.ncfdtridfd(1,0.5,0,1)
     def __check_ncfdtridfn(self):
         cephes.ncfdtridfn(1,0.5,0,1)
     def __check_ncfdtrinc(self):
         cephes.ncfdtrinc(1,0.5,0,1)
 
-    def check_nctdtr(self):
+    def test_nctdtr(self):
         assert_equal(cephes.nctdtr(1,0,0),0.5)
     def __check_nctdtridf(self):
         cephes.nctdtridf(1,0.5,0)
-    def check_nctdtrinc(self):
+    def test_nctdtrinc(self):
         cephes.nctdtrinc(1,0,0)
-    def check_nctdtrit(self):
+    def test_nctdtrit(self):
         cephes.nctdtrit(.1,0.2,.5)
 
-    def check_ndtr(self):
+    def test_ndtr(self):
         assert_equal(cephes.ndtr(0),0.5)
-    def check_ndtri(self):
+    def test_ndtri(self):
         assert_equal(cephes.ndtri(0.5),0.0)
-    def check_nrdtrimn(self):
+    def test_nrdtrimn(self):
         assert_approx_equal(cephes.nrdtrimn(0.5,1,1),1.0)
-    def check_nrdtrisd(self):
+    def test_nrdtrisd(self):
         assert_equal(cephes.nrdtrisd(0.5,0.5,0.5),0.0)
 
-    def check_obl_ang1(self):
+    def test_obl_ang1(self):
         cephes.obl_ang1(1,1,1,0)
-    def check_obl_ang1_cv(self):
+    def test_obl_ang1_cv(self):
         result = cephes.obl_ang1_cv(1,1,1,1,0)
         assert_almost_equal(result[0],1.0)
         assert_almost_equal(result[1],0.0)
 
     def _check_obl_cv(self):
         assert_equal(cephes.obl_cv(1,1,0),2.0)
-    def check_obl_rad1(self):
+    def test_obl_rad1(self):
         cephes.obl_rad1(1,1,1,0)
-    def check_obl_rad1_cv(self):
+    def test_obl_rad1_cv(self):
         cephes.obl_rad1_cv(1,1,1,1,0)
-    def check_obl_rad2(self):
+    def test_obl_rad2(self):
         cephes.obl_rad2(1,1,1,0)
-    def check_obl_rad2_cv(self):
+    def test_obl_rad2_cv(self):
         cephes.obl_rad2_cv(1,1,1,1,0)
 
-    def check_pbdv(self):
+    def test_pbdv(self):
         assert_equal(cephes.pbdv(1,0),(0.0,0.0))
-    def check_pbvv(self):
+    def test_pbvv(self):
         cephes.pbvv(1,0)
-    def check_pbwa(self):
+    def test_pbwa(self):
         cephes.pbwa(1,0)
-    def check_pdtr(self):
+    def test_pdtr(self):
         cephes.pdtr(0,1)
-    def check_pdtrc(self):
+    def test_pdtrc(self):
         cephes.pdtrc(0,1)
-    def check_pdtri(self):
+    def test_pdtri(self):
         cephes.pdtri(0.5,0.5)
-    def check_pdtrik(self):
+    def test_pdtrik(self):
         cephes.pdtrik(0.5,1)
 
-    def check_pro_ang1(self):
+    def test_pro_ang1(self):
         cephes.pro_ang1(1,1,1,0)
-    def check_pro_ang1_cv(self):
+    def test_pro_ang1_cv(self):
         assert_array_almost_equal(cephes.pro_ang1_cv(1,1,1,1,0),
                                   array((1.0,0.0)))
     def _check_pro_cv(self):
         assert_equal(cephes.pro_cv(1,1,0),2.0)
-    def check_pro_rad1(self):
+    def test_pro_rad1(self):
         cephes.pro_rad1(1,1,1,0.1)
-    def check_pro_rad1_cv(self):
+    def test_pro_rad1_cv(self):
         cephes.pro_rad1_cv(1,1,1,1,0)
-    def check_pro_rad2(self):
+    def test_pro_rad2(self):
         cephes.pro_rad2(1,1,1,0)
-    def check_pro_rad2_cv(self):
+    def test_pro_rad2_cv(self):
         cephes.pro_rad2_cv(1,1,1,1,0)
 
-    def check_psi(self):
+    def test_psi(self):
         cephes.psi(1)
 
-    def check_radian(self):
+    def test_radian(self):
         assert_equal(cephes.radian(0,0,0),0)
-    def check_rgamma(self):
+    def test_rgamma(self):
         assert_equal(cephes.rgamma(1),1.0)
-    def check_round(self):
+    def test_round(self):
         assert_equal(cephes.round(3.4),3.0)
         assert_equal(cephes.round(-3.4),-3.0)
         assert_equal(cephes.round(3.6),4.0)
@@ -410,54 +410,54 @@
         assert_equal(cephes.round(3.5),4.0)
         assert_equal(cephes.round(-3.5),-4.0)
 
-    def check_shichi(self):
+    def test_shichi(self):
         cephes.shichi(1)
-    def check_sici(self):
+    def test_sici(self):
         cephes.sici(1)
-    def check_sindg(self):
+    def test_sindg(self):
         assert_equal(cephes.sindg(90),1.0)
-    def check_smirnov(self):
+    def test_smirnov(self):
         assert_equal(cephes.smirnov(1,.1),0.9)
-    def check_smirnovi(self):
+    def test_smirnovi(self):
         assert_almost_equal(cephes.smirnov(1,cephes.smirnovi(1,0.4)),0.4)
         assert_almost_equal(cephes.smirnov(1,cephes.smirnovi(1,0.6)),0.6)
 
-    def check_spence(self):
+    def test_spence(self):
         assert_equal(cephes.spence(1),0.0)
-    def check_stdtr(self):
+    def test_stdtr(self):
         assert_equal(cephes.stdtr(1,0),0.5)
-    def check_stdtridf(self):
+    def test_stdtridf(self):
         cephes.stdtridf(0.7,1)
-    def check_stdtrit(self):
+    def test_stdtrit(self):
         cephes.stdtrit(1,0.7)
-    def check_struve(self):
+    def test_struve(self):
         assert_equal(cephes.struve(0,0),0.0)
 
-    def check_tandg(self):
+    def test_tandg(self):
         assert_equal(cephes.tandg(45),1.0)
-    def check_tklmbda(self):
+    def test_tklmbda(self):
         assert_almost_equal(cephes.tklmbda(1,1),1.0)
 
-    def check_y0(self):
+    def test_y0(self):
         cephes.y0(1)
-    def check_y1(self):
+    def test_y1(self):
         cephes.y1(1)
-    def check_yn(self):
+    def test_yn(self):
         cephes.yn(1,1)
-    def check_yv(self):
+    def test_yv(self):
         cephes.yv(1,1)
     def _check_yve(self):
         cephes.yve(1,1)
 
-    def check_zeta(self):
+    def test_zeta(self):
         cephes.zeta(2,2)
-    def check_zetac(self):
+    def test_zetac(self):
         assert_equal(cephes.zetac(0),-1.5)
-    def check_wofz(self):
+    def test_wofz(self):
         cephes.wofz(0)
 
-class TestAiry(NumpyTestCase):
-    def check_airy(self):
+class TestAiry(TestCase):
+    def test_airy(self):
         #This tests the airy function to ensure 8 place accuracy in computation
 
         x = airy(.99)
@@ -467,7 +467,7 @@
         x = airy(-.36)
         assert_array_almost_equal(x,array([0.44508477,-0.23186773,0.44939534,0.48105354]),8)
 
-    def check_airye(self):
+    def test_airye(self):
         a = airye(0.01)
         b = airy(0.01)
         b1 = [None]*4
@@ -477,7 +477,7 @@
             b1[n] = b[n]*exp(-abs(real(2.0/3.0*0.01*sqrt(0.01))))
         assert_array_almost_equal(a,b1,6)
 
-    def check_bi_zeros(self):
+    def test_bi_zeros(self):
         bi = bi_zeros(2)
         bia = (array([-1.17371322, -3.2710930]),
         array([-2.29443968, -4.07315509]),
@@ -485,43 +485,43 @@
         array([ 0.60195789 , -0.76031014]))
         assert_array_almost_equal(bi,bia,4)
 
-    def check_ai_zeros(self):
+    def test_ai_zeros(self):
         ai = ai_zeros(1)
         assert_array_almost_equal(ai,(array([-2.33810741]),
                                      array([-1.01879297]),
                                      array([ 0.5357]),
                                      array([ 0.7012])),4)
 
-class TestAssocLaguerre(NumpyTestCase):
-    def check_assoc_laguerre(self):
+class TestAssocLaguerre(TestCase):
+    def test_assoc_laguerre(self):
         a1 = genlaguerre(11,1)
         a2 = assoc_laguerre(.2,11,1)
         assert_array_almost_equal(a2,a1(.2),8)
         a2 = assoc_laguerre(1,11,1)
         assert_array_almost_equal(a2,a1(1),8)
 
-class TestBesselpoly(NumpyTestCase):
-    def check_besselpoly(self):
+class TestBesselpoly(TestCase):
+    def test_besselpoly(self):
         pass
 
-class TestKelvin(NumpyTestCase):
-    def check_bei(self):
+class TestKelvin(TestCase):
+    def test_bei(self):
         mbei = bei(2)
         assert_almost_equal(mbei, 0.9722916273066613,5)#this may not be exact
 
-    def check_beip(self):
+    def test_beip(self):
         mbeip = beip(2)
         assert_almost_equal(mbeip,0.91701361338403631,5)#this may not be exact
 
-    def check_ber(self):
+    def test_ber(self):
         mber = ber(2)
         assert_almost_equal(mber,0.75173418271380821,5)#this may not be exact
 
-    def check_berp(self):
+    def test_berp(self):
         mberp = berp(2)
         assert_almost_equal(mberp,-0.49306712470943909,5)#this may not be exact
 
-    def check_bei_zeros(self):
+    def test_bei_zeros(self):
         bi = bi_zeros(5)
         assert_array_almost_equal(bi[0],array([-1.173713222709127,
                                                -3.271093302836352,
@@ -548,7 +548,7 @@
                                                0.929983638568022]),11)
 
 
-    def check_beip_zeros(self):
+    def test_beip_zeros(self):
         bip = beip_zeros(5)
         assert_array_almost_equal(bip,array([  3.772673304934953,
                                                8.280987849760042,
@@ -556,7 +556,7 @@
                                                17.193431752512542,
                                                21.641143941167325]),4)
 
-    def check_ber_zeros(self):
+    def test_ber_zeros(self):
         ber = ber_zeros(5)
         assert_array_almost_equal(ber,array([2.84892,
                                              7.23883,
@@ -564,7 +564,7 @@
                                              16.11356,
                                              20.55463]),4)
 
-    def check_berp_zeros(self):
+    def test_berp_zeros(self):
         brp = berp_zeros(5)
         assert_array_almost_equal(brp,array([6.03871,
                                              10.51364,
@@ -572,30 +572,30 @@
                                              19.41758,
                                              23.86430]),4)
 
-    def check_kelvin(self):
+    def test_kelvin(self):
         mkelv = kelvin(2)
         assert_array_almost_equal(mkelv,(ber(2)+bei(2)*1j,
                                          ker(2)+kei(2)*1j,
                                          berp(2)+beip(2)*1j,
                                          kerp(2)+keip(2)*1j),8)
 
-    def check_kei(self):
+    def test_kei(self):
         mkei = kei(2)
         assert_almost_equal(mkei,-0.20240006776470432,5)
 
-    def  check_keip(self):
+    def test_keip(self):
         mkeip = keip(2)
         assert_almost_equal(mkeip,0.21980790991960536,5)
 
-    def check_ker(self):
+    def test_ker(self):
         mker = ker(2)
         assert_almost_equal(mker,-0.041664513991509472,5)
 
-    def check_kerp(self):
+    def test_kerp(self):
         mkerp = kerp(2)
         assert_almost_equal(mkerp,-0.10660096588105264,5)
 
-    def check_kei_zeros(self):
+    def test_kei_zeros(self):
         kei = kei_zeros(5)
         assert_array_almost_equal(kei,array([  3.91467,
                                               8.34422,
@@ -603,7 +603,7 @@
                                               17.22314,
                                               21.66464]),4)
 
-    def check_keip_zeros(self):
+    def test_keip_zeros(self):
         keip = keip_zeros(5)
         assert_array_almost_equal(keip,array([  4.93181,
                                                 9.40405,
@@ -614,7 +614,7 @@
 
 
     # numbers come from 9.9 of A&S pg. 381
-    def check_kelvin_zeros(self):
+    def test_kelvin_zeros(self):
         tmp = kelvin_zeros(5)
         berz,beiz,kerz,keiz,berpz,beipz,kerpz,keipz = tmp
         assert_array_almost_equal(berz,array([ 2.84892,
@@ -660,7 +660,7 @@
                                                 18.30717,
                                                 22.75379]),4)
 
-    def check_ker_zeros(self):
+    def test_ker_zeros(self):
         ker = ker_zeros(5)
         assert_array_almost_equal(ker,array([  1.71854,
                                                6.12728,
@@ -668,7 +668,7 @@
                                                15.00269,
                                                19.44381]),4)
 
-    def check_kerp_zeros(self):
+    def test_kerp_zeros(self):
         kerp = kerp_zeros(5)
         assert_array_almost_equal(kerp,array([  2.66584,
                                                 7.17212,
@@ -676,8 +676,8 @@
                                                 16.08312,
                                                 20.53068]),4)
 
-class TestBernoulli(NumpyTestCase):
-    def check_bernoulli(self):
+class TestBernoulli(TestCase):
+    def test_bernoulli(self):
         brn = bernoulli(5)
         assert_array_almost_equal(brn,array([1.0000,
                                              -0.5000,
@@ -686,28 +686,28 @@
                                              -0.0333,
                                              0.0000]),4)
 
-class TestBeta(NumpyTestCase):
-    def check_beta(self):
+class TestBeta(TestCase):
+    def test_beta(self):
         bet = beta(2,4)
         betg = (gamma(2)*gamma(4))/gamma(6)
         assert_almost_equal(bet,betg,8)
 
-    def check_betaln(self):
+    def test_betaln(self):
         betln = betaln(2,4)
         bet = log(abs(beta(2,4)))
         assert_almost_equal(betln,bet,8)
 
-    def check_betainc(self):
+    def test_betainc(self):
         btinc = betainc(1,1,.2)
         assert_almost_equal(btinc,0.2,8)
 
-    def check_betaincinv(self):
+    def test_betaincinv(self):
         y = betaincinv(2,4,.5)
         comp = betainc(2,4,y)
         assert_almost_equal(comp,.5,5)
 
-class TestCheby(NumpyTestCase):
-    def check_chebyc(self):
+class TestCheby(TestCase):
+    def test_chebyc(self):
         C0 = chebyc(0)
         C1 = chebyc(1)
         C2 = chebyc(2)
@@ -722,7 +722,7 @@
         assert_array_almost_equal(C4.c,[1,0,-4,0,2],13)
         assert_array_almost_equal(C5.c,[1,0,-5,0,5,0],13)
 
-    def check_chebys(self):
+    def test_chebys(self):
         S0 = chebys(0)
         S1 = chebys(1)
         S2 = chebys(2)
@@ -736,7 +736,7 @@
         assert_array_almost_equal(S4.c,[1,0,-3,0,1],13)
         assert_array_almost_equal(S5.c,[1,0,-4,0,3,0],13)
 
-    def check_chebyt(self):
+    def test_chebyt(self):
         T0 = chebyt(0)
         T1 = chebyt(1)
         T2 = chebyt(2)
@@ -750,7 +750,7 @@
         assert_array_almost_equal(T4.c,[8,0,-8,0,1],13)
         assert_array_almost_equal(T5.c,[16,0,-20,0,5,0],13)
 
-    def check_chebyu(self):
+    def test_chebyu(self):
         U0 = chebyu(0)
         U1 = chebyu(1)
         U2 = chebyu(2)
@@ -764,43 +764,43 @@
         assert_array_almost_equal(U4.c,[16,0,-12,0,1],13)
         assert_array_almost_equal(U5.c,[32,0,-32,0,6,0],13)
 
-class TestTrigonometric(NumpyTestCase):
-    def check_cbrt(self):
+class TestTrigonometric(TestCase):
+    def test_cbrt(self):
         cb = cbrt(27)
         cbrl = 27**(1.0/3.0)
         assert_approx_equal(cb,cbrl)
 
-    def check_cbrtmore(self):
+    def test_cbrtmore(self):
         cb1 = cbrt(27.9)
         cbrl1 = 27.9**(1.0/3.0)
         assert_almost_equal(cb1,cbrl1,8)
 
-    def check_cosdg(self):
+    def test_cosdg(self):
         cdg = cosdg(90)
         cdgrl = cos(pi/2.0)
         assert_almost_equal(cdg,cdgrl,8)
 
-    def check_cosdgmore(self):
+    def test_cosdgmore(self):
         cdgm = cosdg(30)
         cdgmrl = cos(pi/6.0)
         assert_almost_equal(cdgm,cdgmrl,8)
 
-    def check_cosm1(self):
+    def test_cosm1(self):
         cs = (cosm1(0),cosm1(.3),cosm1(pi/10))
         csrl = (cos(0)-1,cos(.3)-1,cos(pi/10)-1)
         assert_array_almost_equal(cs,csrl,8)
 
-    def check_cotdg(self):
+    def test_cotdg(self):
         ct = cotdg(30)
         ctrl = tan(pi/6.0)**(-1)
         assert_almost_equal(ct,ctrl,8)
 
-    def check_cotdgmore(self):
+    def test_cotdgmore(self):
         ct1 = cotdg(45)
         ctrl1 = tan(pi/4.0)**(-1)
         assert_almost_equal(ct1,ctrl1,8)
 
-    def check_specialpoints(self):
+    def test_specialpoints(self):
         assert_almost_equal(cotdg(45), 1.0, 14)
         assert_almost_equal(cotdg(-45), -1.0, 14)
         assert_almost_equal(cotdg(90), 0.0, 14)
@@ -815,21 +815,21 @@
         assert_almost_equal(cotdg(-315), 1.0, 14)
         assert_almost_equal(cotdg(765), 1.0, 14)
 
-    def check_sinc(self):
+    def test_sinc(self):
         c = arange(-2,2,.1)
         y = sinc(c)
         yre = sin(pi*c)/(pi*c)
         yre[20] = 1.0
         assert_array_almost_equal(y, yre, 4)
-    def check_0(self):
+    def test_0(self):
         x = 0.0
         assert_equal(sinc(x),1.0)
 
-    def check_sindg(self):
+    def test_sindg(self):
         sn = sindg(90)
         assert_equal(sn,1.0)
 
-    def check_sindgmore(self):
+    def test_sindgmore(self):
         snm = sindg(30)
         snmrl = sin(pi/6.0)
         assert_almost_equal(snm,snmrl,8)
@@ -837,14 +837,14 @@
         snmrl1 = sin(pi/4.0)
         assert_almost_equal(snm1,snmrl1,8)
 
-class TestTandg(NumpyTestCase):
+class TestTandg(TestCase):
 
-    def check_tandg(self):
+    def test_tandg(self):
         tn = tandg(30)
         tnrl = tan(pi/6.0)
         assert_almost_equal(tn,tnrl,8)
 
-    def check_tandgmore(self):
+    def test_tandgmore(self):
         tnm = tandg(45)
         tnmrl = tan(pi/4.0)
         assert_almost_equal(tnm,tnmrl,8)
@@ -852,7 +852,7 @@
         tnmrl1 = tan(pi/3.0)
         assert_almost_equal(tnm1,tnmrl1,8)
 
-    def check_specialpoints(self):
+    def test_specialpoints(self):
         assert_almost_equal(tandg(0), 0.0, 14)
         assert_almost_equal(tandg(45), 1.0, 14)
         assert_almost_equal(tandg(-45), -1.0, 14)
@@ -865,17 +865,17 @@
         assert_almost_equal(tandg(315), -1.0, 14)
         assert_almost_equal(tandg(-315), 1.0, 14)
 
-class TestEllip(NumpyTestCase):
-    def check_ellipj(self):
+class TestEllip(TestCase):
+    def test_ellipj(self):
         el = ellipj(0.2,0)
         rel = [sin(0.2),cos(0.2),1.0,0.20]
         assert_array_almost_equal(el,rel,13)
 
-    def check_ellipk(self):
+    def test_ellipk(self):
         elk = ellipk(.2)
         assert_almost_equal(elk,1.659623598610528,11)
 
-    def check_ellipkinc(self):
+    def test_ellipkinc(self):
         elkinc = ellipkinc(pi/2,.2)
         elk = ellipk(0.2)
         assert_almost_equal(elkinc,elk,15)
@@ -886,11 +886,11 @@
         assert_almost_equal(elkinc,0.79398143,8)
         # From pg. 614 of A & S
 
-    def check_ellipe(self):
+    def test_ellipe(self):
         ele = ellipe(.2)
         assert_almost_equal(ele,1.4890350580958529,8)
 
-    def check_ellipeinc(self):
+    def test_ellipeinc(self):
         eleinc = ellipeinc(pi/2,.2)
         ele = ellipe(0.2)
         assert_almost_equal(eleinc,ele,14)
@@ -901,13 +901,13 @@
         assert_almost_equal(eleinc, 0.58823065, 8)
 
 
-class TestErf(NumpyTestCase):
+class TestErf(TestCase):
 
-    def check_erf(self):
+    def test_erf(self):
         er = erf(.25)
         assert_almost_equal(er,0.2763263902,8)
 
-    def check_erf_zeros(self):
+    def test_erf_zeros(self):
         erz = erf_zeros(5)
         erzr= array([1.45061616+1.88094300j,
                      2.24465928+2.61657514j,
@@ -916,15 +916,15 @@
                      3.76900557+4.06069723j])
         assert_array_almost_equal(erz,erzr,4)
 
-    def check_erfcinv(self):
+    def test_erfcinv(self):
         i = erfcinv(1)
         assert_equal(i,0)
 
-    def check_erfinv(self):
+    def test_erfinv(self):
         i = erfinv(0)
         assert_equal(i,0)
 
-    def check_errprint(self):
+    def test_errprint(self):
         a = errprint()
         b = 1-a #a is the state 1-a inverts state
         c = errprint(b) #returns last state 'a'
@@ -933,8 +933,8 @@
         assert_equal(d,b) #makes sure state was returned
         #assert_equal(d,1-a)
 
-class TestEuler(NumpyTestCase):
-    def check_euler(self):
+class TestEuler(TestCase):
+    def test_euler(self):
         eu0 = euler(0)
         eu1 = euler(1)
         eu2 = euler(2)   # just checking segfaults
@@ -955,45 +955,45 @@
         errmax = max(err)
         assert_almost_equal(errmax, 0.0, 14)
 
-class TestExp(NumpyTestCase):
-    def check_exp2(self):
+class TestExp(TestCase):
+    def test_exp2(self):
         ex = exp2(2)
         exrl = 2**2
         assert_equal(ex,exrl)
 
-    def check_exp2more(self):
+    def test_exp2more(self):
         exm = exp2(2.5)
         exmrl = 2**(2.5)
         assert_almost_equal(exm,exmrl,8)
 
-    def check_exp10(self):
+    def test_exp10(self):
         ex = exp10(2)
         exrl = 10**2
         assert_approx_equal(ex,exrl)
 
-    def check_exp10more(self):
+    def test_exp10more(self):
         exm = exp10(2.5)
         exmrl = 10**(2.5)
         assert_almost_equal(exm,exmrl,8)
 
-    def check_expm1(self):
+    def test_expm1(self):
         ex = (expm1(2),expm1(3),expm1(4))
         exrl = (exp(2)-1,exp(3)-1,exp(4)-1)
         assert_array_almost_equal(ex,exrl,8)
 
-    def check_expm1more(self):
+    def test_expm1more(self):
         ex1 = (expm1(2),expm1(2.1),expm1(2.2))
         exrl1 = (exp(2)-1,exp(2.1)-1,exp(2.2)-1)
         assert_array_almost_equal(ex1,exrl1,8)
 
-class TestFresnel(NumpyTestCase):
-    def check_fresnel(self):
+class TestFresnel(TestCase):
+    def test_fresnel(self):
         frs = array(fresnel(.5))
         assert_array_almost_equal(frs,array([0.064732432859999287, 0.49234422587144644]),8)
 
     # values from pg 329  Table 7.11 of A & S
     #  slightly corrected in 4th decimal place
-    def check_fresnel_zeros(self):
+    def test_fresnel_zeros(self):
         szo, czo = fresnel_zeros(5)
         assert_array_almost_equal(szo,
                                   array([ 2.0093+0.2885j,
@@ -1012,86 +1012,86 @@
         assert_array_almost_equal(vals1,0,14)
         assert_array_almost_equal(vals2,0,14)
 
-    def check_fresnelc_zeros(self):
+    def test_fresnelc_zeros(self):
         szo, czo = fresnel_zeros(6)
         frc = fresnelc_zeros(6)
         assert_array_almost_equal(frc,czo,12)
 
-    def check_fresnels_zeros(self):
+    def test_fresnels_zeros(self):
         szo, czo = fresnel_zeros(5)
         frs = fresnels_zeros(5)
         assert_array_almost_equal(frs,szo,12)
 
 
-class TestGamma(NumpyTestCase):
-    def check_gamma(self):
+class TestGamma(TestCase):
+    def test_gamma(self):
         gam = gamma(5)
         assert_equal(gam,24.0)
 
-    def check_gammaln(self):
+    def test_gammaln(self):
         gamln = gammaln(3)
         lngam = log(gamma(3))
         assert_almost_equal(gamln,lngam,8)
 
-    def check_gammainc(self):
+    def test_gammainc(self):
         gama = gammainc(.5,.5)
         assert_almost_equal(gama,.7,1)
 
-    def check_gammaincc(self):
+    def test_gammaincc(self):
         gicc = gammaincc(.5,.5)
         greal = 1 - gammainc(.5,.5)
         assert_almost_equal(gicc,greal,8)
 
-    def check_gammainccinv(self):
+    def test_gammainccinv(self):
         gccinv = gammainccinv(.5,.5)
         gcinv = gammaincinv(.5,.5)
         assert_almost_equal(gccinv,gcinv,8)
 
-    def check_gammaincinv(self):
+    def test_gammaincinv(self):
         y = gammaincinv(.4,.4)
         x = gammainc(.4,y)
         assert_almost_equal(x,0.4,1)
 
-    def check_rgamma(self):
+    def test_rgamma(self):
         rgam = rgamma(8)
         rlgam = 1/gamma(8)
         assert_almost_equal(rgam,rlgam,8)
 
-class TestHankel(NumpyTestCase):
-    def check_negv(self):
+class TestHankel(TestCase):
+    def test_negv(self):
         assert_almost_equal(hankel1(-3,2), -hankel1(3,2), 14)
 
-    def check_hankel1(self):
+    def test_hankel1(self):
         hank1 = hankel1(1,.1)
         hankrl = (jv(1,.1)+yv(1,.1)*1j)
         assert_almost_equal(hank1,hankrl,8)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_almost_equal(hankel1e(-3,2), -hankel1e(3,2), 14)
 
-    def check_hankel1e(self):
+    def test_hankel1e(self):
         hank1e = hankel1e(1,.1)
         hankrle = hankel1(1,.1)*exp(-.1j)
         assert_almost_equal(hank1e,hankrle,8)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_almost_equal(hankel2(-3,2), -hankel2(3,2), 14)
 
-    def check_hankel2(self):
+    def test_hankel2(self):
         hank2 = hankel2(1,.1)
         hankrl2 = (jv(1,.1)-yv(1,.1)*1j)
         assert_almost_equal(hank2,hankrl2,8)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_almost_equal(hankel2e(-3,2), -hankel2e(3,2), 14)
 
-    def check_hankl2e(self):
+    def test_hankl2e(self):
         hank2e = hankel2e(1,.1)
         hankrl2e = hankel2e(1,.1)
         assert_almost_equal(hank2e,hankrl2e,8)
 
-class TestHermite(NumpyTestCase):
-    def check_hermite(self):
+class TestHermite(TestCase):
+    def test_hermite(self):
         H0 = hermite(0)
         H1 = hermite(1)
         H2 = hermite(2)
@@ -1105,7 +1105,7 @@
         assert_array_almost_equal(H4.c,[16,0,-48,0,12],12)
         assert_array_almost_equal(H5.c,[32,0,-160,0,120,0],12)
 
-    def check_hermitenorm(self):
+    def test_hermitenorm(self):
         # He_n(x) = 2**(-n/2) H_n(x/sqrt(2))
         psub = poly1d([1.0/sqrt(2),0])
         H0 = hermitenorm(0)
@@ -1130,9 +1130,9 @@
 
 _gam = cephes.gamma
 
-class TestGegenbauer(NumpyTestCase):
+class TestGegenbauer(TestCase):
 
-    def check_gegenbauer(self):
+    def test_gegenbauer(self):
         a = 5*rand()-0.5
         if any(a==0): a = -0.2
         Ca0 = gegenbauer(0,a)
@@ -1153,31 +1153,31 @@
                                                0,15*poch(a,3),0])/15.0,11)
 
 
-class TestHyper(NumpyTestCase):
-    def check_h1vp(self):
+class TestHyper(TestCase):
+    def test_h1vp(self):
         h1 = h1vp(1,.1)
         h1real = (jvp(1,.1)+yvp(1,.1)*1j)
         assert_almost_equal(h1,h1real,8)
 
-    def check_h2vp(self):
+    def test_h2vp(self):
         h2 = h2vp(1,.1)
         h2real = (jvp(1,.1)-yvp(1,.1)*1j)
         assert_almost_equal(h2,h2real,8)
 
-    def check_hyp0f1(self):
+    def test_hyp0f1(self):
         pass
 
-    def check_hyp1f1(self):
+    def test_hyp1f1(self):
         hyp1 = hyp1f1(.1,.1,.3)
         assert_almost_equal(hyp1, 1.3498588075760032,7)
 
-    def check_hyp1f2(self):
+    def test_hyp1f2(self):
         pass
 
-    def check_hyp2f0(self):
+    def test_hyp2f0(self):
         pass
 
-    def check_hyp2f1(self):
+    def test_hyp2f1(self):
         # a collection of special cases taken from AMS 55
         values = [[0.5, 1, 1.5, 0.2**2, 0.5/0.2*log((1+0.2)/(1-0.2))],
                   [0.5, 1, 1.5, -0.2**2, 1./0.2*arctan(0.2)],
@@ -1200,10 +1200,10 @@
             cv = hyp2f1(a, b, c, x)
             assert_almost_equal(cv, v, 8, err_msg='test #%d' % i)
 
-    def check_hyp3f0(self):
+    def test_hyp3f0(self):
         pass
 
-    def check_hyperu(self):
+    def test_hyperu(self):
         val1 = hyperu(1,0.1,100)
         assert_almost_equal(val1,0.0098153,7)
         a,b = [0.3,0.6,1.2,-2.7],[1.5,3.2,-0.4,-3.2]
@@ -1216,8 +1216,8 @@
                                /(gamma(a)*gamma(2-b)))
         assert_array_almost_equal(hypu,hprl,12)
 
-class TestBessel(NumpyTestCase):
-    def check_i0(self):
+class TestBessel(TestCase):
+    def test_i0(self):
         values = [[0.0, 1.0],
                   [1e-10, 1.0],
                   [0.1, 0.9071009258],
@@ -1231,12 +1231,12 @@
             cv = i0(x) * exp(-x)
             assert_almost_equal(cv, v, 8, err_msg='test #%d' % i)
 
-    def check_i0e(self):
+    def test_i0e(self):
         oize = i0e(.1)
         oizer = ive(0,.1)
         assert_almost_equal(oize,oizer,8)
 
-    def check_i1(self):
+    def test_i1(self):
         values = [[0.0, 0.0],
                   [1e-10, 0.4999999999500000e-10],
                   [0.1, 0.0452984468],
@@ -1249,68 +1249,68 @@
             cv = i1(x) * exp(-x)
             assert_almost_equal(cv, v, 8, err_msg='test #%d' % i)
 
-    def check_i1e(self):
+    def test_i1e(self):
         oi1e = i1e(.1)
         oi1er = ive(1,.1)
         assert_almost_equal(oi1e,oi1er,8)
 
-    def check_iti0k0(self):
+    def test_iti0k0(self):
         iti0 = array(iti0k0(5))
         assert_array_almost_equal(iti0,array([31.848667776169801, 1.5673873907283657]),5)
 
-    def check_it2i0k0(self):
+    def test_it2i0k0(self):
         it2k = it2i0k0(.1)
         assert_array_almost_equal(it2k,array([0.0012503906973464409, 3.3309450354686687]),6)
 
-    def check_itj0y0(self):
+    def test_itj0y0(self):
         it0 = array(itj0y0(.2))
         assert_array_almost_equal(it0,array([0.19933433254006822, -0.34570883800412566]),8)
 
-    def check_it2j0y0(self):
+    def test_it2j0y0(self):
         it2 = array(it2j0y0(.2))
         assert_array_almost_equal(it2,array([0.0049937546274601858, -0.43423067011231614]),8)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_equal(iv(3,2), iv(-3,2))
 
-    def check_iv(self):
+    def test_iv(self):
         iv1 = iv(0,.1)*exp(-.1)
         assert_almost_equal(iv1,0.90710092578230106,10)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_equal(ive(3,2), ive(-3,2))
 
-    def check_ive(self):
+    def test_ive(self):
         ive1 = ive(0,.1)
         iv1 = iv(0,.1)*exp(-.1)
         assert_almost_equal(ive1,iv1,10)
 
-    def check_ivp0(self):
+    def test_ivp0(self):
         assert_almost_equal(iv(1,2), ivp(0,2), 10)
 
-    def check_ivp(self):
+    def test_ivp(self):
         y=(iv(0,2)+iv(2,2))/2
         x = ivp(1,2)
         assert_almost_equal(x,y,10)
 
-    def check_j0(self):
+    def test_j0(self):
         oz = j0(.1)
         ozr = jn(0,.1)
         assert_almost_equal(oz,ozr,8)
 
-    def check_j1(self):
+    def test_j1(self):
         o1 = j1(.1)
         o1r = jn(1,.1)
         assert_almost_equal(o1,o1r,8)
 
-    def check_jn(self):
+    def test_jn(self):
         jnnr = jn(1,.2)
         assert_almost_equal(jnnr,0.099500832639235995,8)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_almost_equal(jv(-3,2), -jv(3,2), 14)
 
-    def check_jv(self):
+    def test_jv(self):
         values = [[0, 0.1, 0.99750156206604002],
                   [2./3, 1e-8, 0.3239028506761532e-5],
                   [2./3, 1e-10, 0.1503423854873779e-6],
@@ -1321,10 +1321,10 @@
             yc = jv(v, x)
             assert_almost_equal(yc, y, 8, err_msg='test #%d' % i)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_almost_equal(jve(-3,2), -jve(3,2), 14)
 
-    def check_jve(self):
+    def test_jve(self):
         jvexp = jve(1,.2)
         assert_almost_equal(jvexp,0.099500832639235995,8)
         jvexp1 = jve(1,.2+1j)
@@ -1332,7 +1332,7 @@
         jvexpr = jv(1,z)*exp(-abs(z.imag))
         assert_almost_equal(jvexp1,jvexpr,8)
 
-    def check_jn_zeros(self):
+    def test_jn_zeros(self):
         jn0 = jn_zeros(0,5)
         jn1 = jn_zeros(1,5)
         assert_array_almost_equal(jn0,array([ 2.4048255577,
@@ -1346,14 +1346,14 @@
                                               13.32369,
                                               16.47063]),4)
 
-    def check_jnjnp_zeros(self):
+    def test_jnjnp_zeros(self):
         pass
         #jnjp = jnjnp(3)
         #assert_array_almost_equal(jnjp,(array([
         #I don't think specfun jdzo is working properly the outputs do not seem to correlate
         #to the inputs
 
-    def check_jnp_zeros(self):
+    def test_jnp_zeros(self):
         jnp = jnp_zeros(1,5)
         assert_array_almost_equal(jnp, array([  1.84118,
                                                 5.33144,
@@ -1361,7 +1361,7 @@
                                                 11.70600,
                                                 14.86359]),4)
 
-    def check_jnyn_zeros(self):
+    def test_jnyn_zeros(self):
         jnz = jnyn_zeros(1,5)
         assert_array_almost_equal(jnz,(array([  3.83171,
                                                 7.01559,
@@ -1384,32 +1384,32 @@
                                                 13.28576,
                                                 16.44006])),4)
 
-    def check_jvp(self):
+    def test_jvp(self):
         jvprim = jvp(2,2)
         jv0 = (jv(1,2)-jv(3,2))/2
         assert_almost_equal(jvprim,jv0,10)
 
-    def check_k0(self):
+    def test_k0(self):
         ozk = k0(.1)
         ozkr = kv(0,.1)
         assert_almost_equal(ozk,ozkr,8)
 
-    def check_k0e(self):
+    def test_k0e(self):
         ozke = k0e(.1)
         ozker = kve(0,.1)
         assert_almost_equal(ozke,ozker,8)
 
-    def check_k1(self):
+    def test_k1(self):
         o1k = k1(.1)
         o1kr = kv(1,.1)
         assert_almost_equal(o1k,o1kr,8)
 
-    def check_k1e(self):
+    def test_k1e(self):
         o1ke = k1e(.1)
         o1ker = kve(1,.1)
         assert_almost_equal(o1ke,o1ker,8)
 
-    def check_jacobi(self):
+    def test_jacobi(self):
         a = 5*rand() - 1
         b = 5*rand() - 1
         P0 = jacobi(0,a,b)
@@ -1427,28 +1427,28 @@
         p3c = [cp[0],cp[1]-3*cp[0],cp[2]-2*cp[1]+3*cp[0],cp[3]-cp[2]+cp[1]-cp[0]]
         assert_array_almost_equal(P3.c,array(p3c)/48.0,13)
 
-    def check_kn(self):
+    def test_kn(self):
         kn1 = kn(0,.2)
         assert_almost_equal(kn1,1.7527038555281462,8)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_equal(kv(3.0, 2.2), kv(-3.0, 2.2))
 
-    def check_kv0(self):
+    def test_kv0(self):
         kv0 = kv(0,.2)
         assert_almost_equal(kv0, 1.7527038555281462, 10)
-    def check_kv1(self):
+    def test_kv1(self):
         kv1 = kv(1,0.2)
         assert_almost_equal(kv1, 4.775972543220472, 10)
-    def check_kv2(self):
+    def test_kv2(self):
         kv2 = kv(2,0.2)
         assert_almost_equal(kv2, 49.51242928773287, 10)
 
 
-    def check_negv(self):
+    def test_negv(self):
         assert_equal(kve(3.0, 2.2), kve(-3.0, 2.2))
 
-    def check_kve(self):
+    def test_kve(self):
         kve1 = kve(0,.2)
         kv1 = kv(0,.2)*exp(.2)
         assert_almost_equal(kve1,kv1,8)
@@ -1457,35 +1457,35 @@
         kv2 = kv(0,z)*exp(z)
         assert_almost_equal(kve2,kv2,8)
 
-    def check_kvp_v0n1(self):
+    def test_kvp_v0n1(self):
         z = 2.2
         assert_almost_equal(-kv(1,z), kvp(0,z, n=1), 10)
 
-    def check_kvp_n1(self):
+    def test_kvp_n1(self):
         v = 3.
         z = 2.2
         xc = -kv(v+1,z) + v/z*kv(v,z)
         x = kvp(v,z, n=1)
         assert_almost_equal(xc, x, 10)   #this function (kvp) is broken
 
-    def check_kvp_n2(self):
+    def test_kvp_n2(self):
         v = 3.
         z = 2.2
         xc = (z**2+v**2-v)/z**2 * kv(v,z) + kv(v+1,z)/z
         x = kvp(v, z, n=2)
         assert_almost_equal(xc, x, 10)
 
-    def check_y0(self):
+    def test_y0(self):
         oz = y0(.1)
         ozr = yn(0,.1)
         assert_almost_equal(oz,ozr,8)
 
-    def check_y1(self):
+    def test_y1(self):
         o1 = y1(.1)
         o1r = yn(1,.1)
         assert_almost_equal(o1,o1r,8)
 
-    def check_y0_zeros(self):
+    def test_y0_zeros(self):
         yo,ypo = y0_zeros(2)
         zo,zpo = y0_zeros(2,complex=1)
         all = r_[yo,zo]
@@ -1494,51 +1494,51 @@
         assert_array_almost_equal(abs(yv(1,all)-allval),0.0,11)
 
 
-    def check_y1_zeros(self):
+    def test_y1_zeros(self):
         y1 = y1_zeros(1)
         assert_array_almost_equal(y1,(array([2.19714]),array([0.52079])),5)
 
-    def check_y1p_zeros(self):
+    def test_y1p_zeros(self):
         y1p = y1p_zeros(1,complex=1)
         assert_array_almost_equal(y1p,(array([ 0.5768+0.904j]), array([-0.7635+0.5892j])),3)
 
-    def check_yn_zeros(self):
+    def test_yn_zeros(self):
         an = yn_zeros(4,2)
         assert_array_almost_equal(an,array([ 5.64515,  9.36162]),5)
 
-    def check_ynp_zeros(self):
+    def test_ynp_zeros(self):
         ao = ynp_zeros(0,2)
         assert_array_almost_equal(ao,array([ 2.19714133, 5.42968104]),6)
 
-    def check_yn(self):
+    def test_yn(self):
         yn2n = yn(1,.2)
         assert_almost_equal(yn2n,-3.3238249881118471,8)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_almost_equal(yv(-3,2), -yv(3,2), 14)
 
-    def check_yv(self):
+    def test_yv(self):
         yv2 = yv(1,.2)
         assert_almost_equal(yv2,-3.3238249881118471,8)
 
-    def check_negv(self):
+    def test_negv(self):
         assert_almost_equal(yve(-3,2), -yve(3,2), 14)
 
-    def check_yve(self):
+    def test_yve(self):
         yve2 = yve(1,.2)
         assert_almost_equal(yve2,-3.3238249881118471,8)
         yve2r = yv(1,.2+1j)*exp(-1)
         yve22 = yve(1,.2+1j)
         assert_almost_equal(yve22,yve2r,8)
 
-    def check_yvp(self):
+    def test_yvp(self):
         yvpr = (yv(1,.2) - yv(3,.2))/2.0
         yvp1 = yvp(2,.2)
         assert_array_almost_equal(yvp1,yvpr,10)
 
 
-class TestLaguerre(NumpyTestCase):
-    def check_laguerre(self):
+class TestLaguerre(TestCase):
+    def test_laguerre(self):
         lag0 = laguerre(0)
         lag1 = laguerre(1)
         lag2 = laguerre(2)
@@ -1552,7 +1552,7 @@
         assert_array_almost_equal(lag4.c,array([1,-16,72,-96,24])/24.0,13)
         assert_array_almost_equal(lag5.c,array([-1,25,-200,600,-600,120])/120.0,13)
 
-    def check_genlaguerre(self):
+    def test_genlaguerre(self):
         k = 5*rand()-0.9
         lag0 = genlaguerre(0,k)
         lag1 = genlaguerre(1,k)
@@ -1565,8 +1565,8 @@
 
 
 # Base polynomials come from Abrahmowitz and Stegan
-class TestLegendre(NumpyTestCase):
-    def check_legendre(self):
+class TestLegendre(TestCase):
+    def test_legendre(self):
         leg0 = legendre(0)
         leg1 = legendre(1)
         leg2 = legendre(2)
@@ -1581,26 +1581,26 @@
         assert_almost_equal(leg5.c,array([63,0,-70,0,15,0])/8.0)
 
 
-class TestLambda(NumpyTestCase):
-    def check_lmbda(self):
+class TestLambda(TestCase):
+    def test_lmbda(self):
         lam = lmbda(1,.1)
         lamr = (array([jn(0,.1), 2*jn(1,.1)/.1]),
                 array([jvp(0,.1), -2*jv(1,.1)/.01 + 2*jvp(1,.1)/.1]))
         assert_array_almost_equal(lam,lamr,8)
 
-class TestLog1p(NumpyTestCase):
-    def check_log1p(self):
+class TestLog1p(TestCase):
+    def test_log1p(self):
         l1p = (log1p(10),log1p(11),log1p(12))
         l1prl = (log(11),log(12),log(13))
         assert_array_almost_equal(l1p,l1prl,8)
 
-    def check_log1pmore(self):
+    def test_log1pmore(self):
         l1pm = (log1p(1),log1p(1.1),log1p(1.2))
         l1pmrl = (log(2),log(2.1),log(2.2))
         assert_array_almost_equal(l1pm,l1pmrl,8)
 
-class TestLegendreFunctions(NumpyTestCase):
-    def check_lpmn(self):
+class TestLegendreFunctions(TestCase):
+    def test_lpmn(self):
         lp = lpmn(0,2,.5)
         assert_array_almost_equal(lp,(array([       [ 1.00000 ,
                                                       0.50000,
@@ -1609,7 +1609,7 @@
                                                       1.00000 ,
                                                       1.50000]])),4)
 
-    def check_lpn(self):
+    def test_lpn(self):
         lpnf = lpn(2,.5)
         assert_array_almost_equal(lpnf,(array(      [ 1.00000 ,
                                                         0.50000,
@@ -1618,111 +1618,111 @@
                                                       1.00000 ,
                                                       1.50000])),4)
 
-    def check_lpmv(self):
+    def test_lpmv(self):
         lp = lpmv(0,2,.5)
         assert_almost_equal(lp,-0.125,3)
 
-    def check_lqmn(self):
+    def test_lqmn(self):
         lqmnf = lqmn(0,2,.5)
         lqmnf = lqmn(0,2,.5)
         lqf = lqn(2,.5)
         assert_array_almost_equal(lqmnf[0][0],lqf[0],4)
         assert_array_almost_equal(lqmnf[1][0],lqf[1],4)
 
-    def check_lqn(self):
+    def test_lqn(self):
         lqf = lqn(2,.5)
         assert_array_almost_equal(lqf,(array([ 0.5493, -0.7253, -0.8187]),
                                        array([ 1.3333,  1.216 , -0.8427])),4)
 
-class TestMathieu(NumpyTestCase):
+class TestMathieu(TestCase):
 
-    def check_mathieu_a(self):
+    def test_mathieu_a(self):
         pass
 
-    def check_mathieu_even_coef(self):
+    def test_mathieu_even_coef(self):
         mc =  mathieu_even_coef(2,5)
         #Q not defined broken and cannot figure out proper reporting order
 
-    def check_mathieu_odd_coef(self):
+    def test_mathieu_odd_coef(self):
         pass
             #same problem as above
 
-class TestFresnelIntegral(NumpyTestCase):
+class TestFresnelIntegral(TestCase):
 
-    def check_modfresnelp(self):
+    def test_modfresnelp(self):
         pass
 
-    def check_modfresnelm(self):
+    def test_modfresnelm(self):
         pass
 
-class TestOblCvSeq(NumpyTestCase):
-    def check_obl_cv_seq(self):
+class TestOblCvSeq(TestCase):
+    def test_obl_cv_seq(self):
         obl = obl_cv_seq(0,3,1)
         assert_array_almost_equal(obl,array([ -0.348602,
                                               1.393206,
                                               5.486800,
                                               11.492120]),5)
 
-class TestParabolicCylinder(NumpyTestCase):
-    def check_pbdn_seq(self):
+class TestParabolicCylinder(TestCase):
+    def test_pbdn_seq(self):
         pb = pbdn_seq(1,.1)
         assert_array_almost_equal(pb,(array([ 0.9975,
                                               0.0998]),
                                       array([-0.0499,
                                              0.9925])),4)
 
-    def check_pbdv(self):
+    def test_pbdv(self):
         pbv = pbdv(1,.2)
         derrl = 1/2*(.2)*pbdv(1,.2)[0] - pbdv(0,.2)[0]
 
-    def check_pbdv_seq(self):
+    def test_pbdv_seq(self):
         pbn = pbdn_seq(1,.1)
         pbv = pbdv_seq(1,.1)
         assert_array_almost_equal(pbv,(real(pbn[0]),real(pbn[1])),4)
 
-class TestPolygamma(NumpyTestCase):
+class TestPolygamma(TestCase):
     # from Table 6.2 (pg. 271) of A&S
-    def check_polygamma(self):
+    def test_polygamma(self):
         poly2 = polygamma(2,1)
         poly3 = polygamma(3,1)
         assert_almost_equal(poly2,-2.4041138063,10)
         assert_almost_equal(poly3,6.4939394023,10)
 
-class TestProCvSeq(NumpyTestCase):
-    def check_pro_cv_seq(self):
+class TestProCvSeq(TestCase):
+    def test_pro_cv_seq(self):
         prol = pro_cv_seq(0,3,1)
         assert_array_almost_equal(prol,array([  0.319000,
                                                2.593084,
                                                6.533471,
                                                12.514462]),5)
 
-class TestPsi(NumpyTestCase):
-    def check_psi(self):
+class TestPsi(TestCase):
+    def test_psi(self):
         ps = psi(1)
         assert_almost_equal(ps,-0.57721566490153287,8)
 
-class TestRadian(NumpyTestCase):
-    def check_radian(self):
+class TestRadian(TestCase):
+    def test_radian(self):
         rad = radian(90,0,0)
         assert_almost_equal(rad,pi/2.0,5)
 
-    def check_radianmore(self):
+    def test_radianmore(self):
         rad1 = radian(90,1,60)
         assert_almost_equal(rad1,pi/2+0.0005816135199345904,5)
 
-class TestRiccati(NumpyTestCase):
-    def check_riccati_jn(self):
+class TestRiccati(TestCase):
+    def test_riccati_jn(self):
         jnrl = (sph_jn(1,.2)[0]*.2,sph_jn(1,.2)[0]+sph_jn(1,.2)[1]*.2)
         ricjn = riccati_jn(1,.2)
         assert_array_almost_equal(ricjn,jnrl,8)
 
-    def check_riccati_yn(self):
+    def test_riccati_yn(self):
         ynrl = (sph_yn(1,.2)[0]*.2,sph_yn(1,.2)[0]+sph_yn(1,.2)[1]*.2)
         ricyn = riccati_yn(1,.2)
         assert_array_almost_equal(ricyn,ynrl,8)
 
-class TestRound(NumpyTestCase):
-    def check_round(self):
+class TestRound(TestCase):
+    def test_round(self):
         rnd = map(int,(round(10.1),round(10.4),round(10.5),round(10.6)))
 
         # Note: According to the documentation, scipy.special.round is
@@ -1733,9 +1733,9 @@
         rndrl = (10,10,10,11)
         assert_array_equal(rnd,rndrl)
 
-class _test_sh_legendre(NumpyTestCase):
+class _test_sh_legendre(TestCase):
 
-    def check_sh_legendre(self):
+    def test_sh_legendre(self):
         # P*_n(x) = P_n(2x-1)
         psub = poly1d([2,-1])
         Ps0 = sh_legendre(0)
@@ -1757,9 +1757,9 @@
         assert_array_almost_equal(Ps4.c,pse4.c,12)
         assert_array_almost_equal(Ps5.c,pse5.c,12)
 
-class _test_sh_chebyt(NumpyTestCase):
+class _test_sh_chebyt(TestCase):
 
-    def check_sh_chebyt(self):
+    def test_sh_chebyt(self):
         # T*_n(x) = T_n(2x-1)
         psub = poly1d([2,-1])
         Ts0 = sh_chebyt(0)
@@ -1782,9 +1782,9 @@
         assert_array_almost_equal(Ts5.c,tse5.c,12)
 
 
-class _test_sh_chebyu(NumpyTestCase):
+class _test_sh_chebyu(TestCase):
 
-    def check_sh_chebyu(self):
+    def test_sh_chebyu(self):
         # U*_n(x) = U_n(2x-1)
         psub = poly1d([2,-1])
         Us0 = sh_chebyu(0)
@@ -1806,9 +1806,9 @@
         assert_array_almost_equal(Us4.c,use4.c,12)
         assert_array_almost_equal(Us5.c,use5.c,11)
 
-class _test_sh_jacobi(NumpyTestCase):
+class _test_sh_jacobi(TestCase):
 
-    def check_sh_jacobi(self):
+    def test_sh_jacobi(self):
         # G^(p,q)_n(x) = n! gamma(n+p)/gamma(2*n+p) * P^(p-q,q-1)_n(2*x-1)
         conv = lambda n,p: _gam(n+1)*_gam(n+p)/_gam(2*n+p)
         psub = poly1d([2,-1])
@@ -1835,11 +1835,11 @@
         assert_array_almost_equal(G4.c,ge4.c,13)
         assert_array_almost_equal(G5.c,ge5.c,13)
 
-class TestSpherical(NumpyTestCase):
-    def check_sph_harm(self):
+class TestSpherical(TestCase):
+    def test_sph_harm(self):
         pass
 
-    def check_sph_in(self):
+    def test_sph_in(self):
         i1n = sph_in(1,.2)
         inp0 = (i1n[0][1])
         inp1 = (i1n[0][0] - 2.0/0.2 * i1n[0][1])
@@ -1847,12 +1847,12 @@
                                                 0.066933714568029540839]),12)
         assert_array_almost_equal(i1n[1],[inp0,inp1],12)
 
-    def check_sph_inkn(self):
+    def test_sph_inkn(self):
         spikn = r_[sph_in(1,.2)+sph_kn(1,.2)]
         inkn = r_[sph_inkn(1,.2)]
         assert_array_almost_equal(inkn,spikn,10)
 
-    def check_sph_jn(self):
+    def test_sph_jn(self):
         s1 = sph_jn(2,.2)
         s10 = -s1[0][1]
         s11 = s1[0][0]-2.0/0.2*s1[0][1]
@@ -1862,12 +1862,12 @@
                                       0.0026590560795273856680],12)
         assert_array_almost_equal(s1[1],[s10,s11,s12],12)
 
-    def check_sph_jnyn(self):
+    def test_sph_jnyn(self):
         jnyn = r_[sph_jn(1,.2) + sph_yn(1,.2)]  # tuple addition
         jnyn1 = r_[sph_jnyn(1,.2)]
         assert_array_almost_equal(jnyn1,jnyn,9)
 
-    def check_sph_kn(self):
+    def test_sph_kn(self):
         kn = sph_kn(2,.2)
         kn0 = -kn[0][1]
         kn1 = -kn[0][0]-2.0/0.2*kn[0][1]
@@ -1877,7 +1877,7 @@
                                          585.15696310385559829],12)
         assert_array_almost_equal(kn[1],[kn0,kn1,kn2],9)
 
-    def check_sph_yn(self):
+    def test_sph_yn(self):
         sy1 = sph_yn(2,.2)[0][2]
         sy2 = sph_yn(0,.2)[0][0]
         sphpy = (sph_yn(1,.2)[0][0]-2*sph_yn(2,.2)[0][2])/3 #correct derivative value
@@ -1887,4 +1887,4 @@
         assert_almost_equal(sy3,sphpy,4) #compare correct derivative val. (correct =-system val).
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/special/tests/test_spfun_stats.py
===================================================================
--- trunk/scipy/special/tests/test_spfun_stats.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/special/tests/test_spfun_stats.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,11 +1,11 @@
 import numpy as N
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
+
 from scipy.special import gammaln, multigammaln
-restore_path()
 
-class TestMultiGammaLn(NumpyTestCase):
+
+class TestMultiGammaLn(TestCase):
     def test1(self):
         a = N.abs(N.random.randn())
         assert_array_equal(multigammaln(a, 1), gammaln(a))
@@ -35,4 +35,4 @@
             pass
 
 if __name__ == '__main__':
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/__init__.py
===================================================================
--- trunk/scipy/stats/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -11,5 +11,5 @@
 from kde import gaussian_kde
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/stats/models/__init__.py
===================================================================
--- trunk/scipy/stats/models/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/models/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -16,5 +16,5 @@
 
 __all__ = filter(lambda s:not s.startswith('_'),dir())
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/stats/models/tests/test_bspline.py
===================================================================
--- trunk/scipy/stats/models/tests/test_bspline.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/models/tests/test_bspline.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,13 +3,13 @@
 """
 
 import numpy as N
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import *
 
 import scipy.stats.models as S
 import scipy.stats.models.bspline as B
 
 
-class TestBSpline(NumpyTestCase):
+class TestBSpline(TestCase):
 
     def test1(self):
         b = B.BSpline(N.linspace(0,10,11), x=N.linspace(0,10,101))
@@ -20,4 +20,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/models/tests/test_formula.py
===================================================================
--- trunk/scipy/stats/models/tests/test_formula.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/models/tests/test_formula.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -7,11 +7,11 @@
 import numpy as N
 import numpy.random as R
 import numpy.linalg as L
-from numpy.testing import assert_almost_equal, NumpyTest, NumpyTestCase
+from scipy.testing import *
 
 from scipy.stats.models import utils, formula, contrast
 
-class TestTerm(NumpyTestCase):
+class TestTerm(TestCase):
 
     def test_init(self):
         t1 = formula.Term("trivial")
@@ -47,7 +47,7 @@
         f = intercept * t1
         self.assertEqual(str(f), str(formula.Formula(t1)))
 
-class TestFormula(NumpyTestCase):
+class TestFormula(TestCase):
 
     def setUp(self):
         self.X = R.standard_normal((40,10))
@@ -227,4 +227,4 @@
         self.assertEquals(estimable, False)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/models/tests/test_glm.py
===================================================================
--- trunk/scipy/stats/models/tests/test_glm.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/models/tests/test_glm.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,16 +4,16 @@
 
 import numpy as N
 import numpy.random as R
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import *
 
 import scipy.stats.models as S
 import scipy.stats.models.glm as models
 
 W = R.standard_normal
 
-class TestRegression(NumpyTestCase):
+class TestRegression(TestCase):
 
-    def check_Logistic(self):
+    def test_Logistic(self):
         X = W((40,10))
         Y = N.greater(W((40,)), 0)
         family = S.family.Binomial()
@@ -21,7 +21,7 @@
         results = cmodel.fit(Y)
         self.assertEquals(results.df_resid, 30)
 
-    def check_Logisticdegenerate(self):
+    def test_Logisticdegenerate(self):
         X = W((40,10))
         X[:,0] = X[:,1] + X[:,2]
         Y = N.greater(W((40,)), 0)
@@ -31,4 +31,4 @@
         self.assertEquals(results.df_resid, 31)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/models/tests/test_regression.py
===================================================================
--- trunk/scipy/stats/models/tests/test_regression.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/models/tests/test_regression.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,13 +3,13 @@
 """
 
 from numpy.random import standard_normal
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import *
 
 from scipy.stats.models.regression import OLSModel, ARModel
 
 W = standard_normal
 
-class TestRegression(NumpyTestCase):
+class TestRegression(TestCase):
 
     def testOLS(self):
         X = W((40,10))
@@ -42,4 +42,4 @@
         self.assertEquals(results.df_resid, 31)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/models/tests/test_rlm.py
===================================================================
--- trunk/scipy/stats/models/tests/test_rlm.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/models/tests/test_rlm.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,13 +3,13 @@
 """
 
 import numpy.random as R
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import *
 
 import scipy.stats.models.rlm as models
 
 W = R.standard_normal
 
-class TestRegression(NumpyTestCase):
+class TestRegression(TestCase):
 
     def test_Robust(self):
         X = W((40,10))
@@ -27,4 +27,4 @@
         self.assertEquals(results.df_resid, 31)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/models/tests/test_scale.py
===================================================================
--- trunk/scipy/stats/models/tests/test_scale.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/models/tests/test_scale.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,13 +3,13 @@
 """
 
 import numpy.random as R
-from numpy.testing import NumpyTest, NumpyTestCase
+from scipy.testing import *
 
 import scipy.stats.models.robust.scale as scale
 
 W = R.standard_normal
 
-class TestScale(NumpyTestCase):
+class TestScale(TestCase):
 
     def test_MAD(self):
         X = W((40,10))
@@ -50,4 +50,4 @@
         self.assertEquals(m.shape, (40,10))
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/models/tests/test_utils.py
===================================================================
--- trunk/scipy/stats/models/tests/test_utils.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/models/tests/test_utils.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,11 +4,11 @@
 
 import numpy as N
 import numpy.random as R
-from numpy.testing import assert_almost_equal, NumpyTest, NumpyTestCase
+from scipy.testing import *
 
 from scipy.stats.models import utils
 
-class TestUtils(NumpyTestCase):
+class TestUtils(TestCase):
 
     def test_recipr(self):
         X = N.array([[2,1],[-1,0]])
@@ -55,4 +55,4 @@
         self.assertRaises(ValueError, utils.StepFunction, x, y)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/morestats.py
===================================================================
--- trunk/scipy/stats/morestats.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/morestats.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -17,6 +17,7 @@
 import scipy.special as special
 import futil
 import numpy as sb
+from scipy.testing.decorators import is_nosetest
 
 __all__ = ['find_repeats',
            'bayes_mvs', 'kstat', 'kstatvar', 'probplot', 'ppcc_max', 'ppcc_plot',
@@ -769,6 +770,7 @@
     pval = distributions.f.sf(W,k-1,Ntot-k) # 1 - cdf
     return W, pval
 
+@is_nosetest(False)
 def binom_test(x,n=None,p=0.5):
     """An exact (two-sided) test of the null hypothesis that the
     probability of success in a Bernoulli experiment is p.

Modified: trunk/scipy/stats/tests/test_distributions.py
===================================================================
--- trunk/scipy/stats/tests/test_distributions.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/tests/test_distributions.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -2,18 +2,14 @@
 
 """
 
+from scipy.testing import *
 
-from numpy.testing import *
 
-set_package_path()
 import numpy
 from numpy import typecodes, array
-import stats
-restore_path()
+import scipy.stats as stats
 
-import types
-
-def kolmogorov_test(diststr,args=(),N=20,significance=0.01):
+def kolmogorov_check(diststr,args=(),N=20,significance=0.01):
     qtest = stats.ksoneisf(significance,N)
     cdf = eval('stats.'+diststr+'.cdf')
     dist = eval('stats.'+diststr)
@@ -27,7 +23,6 @@
 
 
 # generate test cases to test cdf and distribution consistency
-
 dists = ['uniform','norm','lognorm','expon','beta',
          'powerlaw','bradford','burr','fisk','cauchy','halfcauchy',
          'foldcauchy','gamma','gengamma','loggamma',
@@ -40,39 +35,41 @@
          'genlogistic', 'logistic','gumbel_l','gumbel_r','gompertz',
          'hypsecant', 'laplace', 'reciprocal','triang','tukeylambda']
 
-for dist in dists:
-    distfunc = eval('stats.'+dist)
-    nargs = distfunc.numargs
-    alpha = 0.01
-    if dist == 'fatiguelife':
-        alpha = 0.001
-    if dist == 'erlang':
-        args = str((4,)+tuple(rand(2)))
-    elif dist == 'frechet':
-        args = str(tuple(2*rand(1))+(0,)+tuple(2*rand(2)))
-    elif dist == 'triang':
-        args = str(tuple(rand(nargs)))
-    elif dist == 'reciprocal':
-        vals = rand(nargs)
-        vals[1] = vals[0] + 1.0
-        args = str(tuple(vals))
-    else:
-        args = str(tuple(1.0+rand(nargs)))
-    exstr = r"""
-class Test%(dist)s(NumpyTestCase):
-    def check_cdf(self):
-        D,pval = stats.kstest('%(dist)s','',args=%(args)s,N=30)
-        if (pval < %(alpha)f):
-            D,pval = stats.kstest('%(dist)s','',args=%(args)s,N=30)
-            #if (pval < %(alpha)f):
-            #    D,pval = stats.kstest('%(dist)s','',args=%(args)s,N=30)
-        assert (pval > %(alpha)f), "D = " + str(D) + "; pval = " + str(pval) + "; alpha = " + str(alpha) + "\nargs = " + str(%(args)s)
-""" % {'dist' : dist, 'args' : args, 'alpha' : alpha}
-    exec exstr
+# check function for test generator
+def check_distribution(dist, args, alpha):
+    D,pval = stats.kstest(dist,'', args=args, N=30)
+    if (pval < alpha):
+        D,pval = stats.kstest(dist,'',args=args, N=30)
+        #if (pval < alpha):
+        #    D,pval = stats.kstest(dist,'',args=args, N=30)
+        assert (pval > alpha), "D = " + str(D) + "; pval = " + str(pval) + \
+               "; alpha = " + str(alpha) + "\nargs = " + str(args)
 
+# nose test generator
+def test_all_distributions():
+    for dist in dists:
+        distfunc = eval('stats.'+dist)
+        nargs = distfunc.numargs
+        alpha = 0.01
+        if dist == 'fatiguelife':
+            alpha = 0.001
+        if dist == 'erlang':
+            args = (4,)+tuple(rand(2))
+        elif dist == 'frechet':
+            args = tuple(2*rand(1))+(0,)+tuple(2*rand(2))
+        elif dist == 'triang':
+            args = tuple(rand(nargs))
+        elif dist == 'reciprocal':
+            vals = rand(nargs)
+            vals[1] = vals[0] + 1.0
+            args = tuple(vals)
+        else:
+            args = tuple(1.0+rand(nargs))
+        yield check_distribution, dist, args, alpha
 
-class TestRandInt(NumpyTestCase):
-    def check_rvs(self):
+
+class TestRandInt(TestCase):
+    def test_rvs(self):
         vals = stats.randint.rvs(5,30,size=100)
         assert(numpy.all(vals < 30) & numpy.all(vals >= 5))
         assert(len(vals) == 100)
@@ -84,21 +81,21 @@
         assert isinstance(val, numpy.ScalarType),`type(val)`
         assert(val.dtype.char in typecodes['AllInteger'])
 
-    def check_pdf(self):
+    def test_pdf(self):
         k = numpy.r_[0:36]
         out = numpy.where((k >= 5) & (k < 30), 1.0/(30-5), 0)
         vals = stats.randint.pmf(k,5,30)
         assert_array_almost_equal(vals,out)
 
-    def check_cdf(self):
+    def test_cdf(self):
         x = numpy.r_[0:36:100j]
         k = numpy.floor(x)
         out = numpy.select([k>=30,k>=5],[1.0,(k-5.0+1)/(30-5.0)],0)
         vals = stats.randint.cdf(x,5,30)
         assert_array_almost_equal(vals, out, decimal=12)
 
-class TestBinom(NumpyTestCase):
-    def check_rvs(self):
+class TestBinom(TestCase):
+    def test_rvs(self):
         vals = stats.binom.rvs(10, 0.75, size=(2, 50))
         assert(numpy.all(vals >= 0) & numpy.all(vals <= 10))
         assert(numpy.shape(vals) == (2, 50))
@@ -108,8 +105,8 @@
         assert(val.dtype.char in typecodes['AllInteger'])
 
 
-class TestBernoulli(NumpyTestCase):
-    def check_rvs(self):
+class TestBernoulli(TestCase):
+    def test_rvs(self):
         vals = stats.bernoulli.rvs(0.75, size=(2, 50))
         assert(numpy.all(vals >= 0) & numpy.all(vals <= 1))
         assert(numpy.shape(vals) == (2, 50))
@@ -118,8 +115,8 @@
         assert(isinstance(val, numpy.ndarray))
         assert(val.dtype.char in typecodes['AllInteger'])
 
-class TestNBinom(NumpyTestCase):
-    def check_rvs(self):
+class TestNBinom(TestCase):
+    def test_rvs(self):
         vals = stats.nbinom.rvs(10, 0.75, size=(2, 50))
         assert(numpy.all(vals >= 0))
         assert(numpy.shape(vals) == (2, 50))
@@ -128,8 +125,8 @@
         assert(isinstance(val, numpy.ndarray))
         assert(val.dtype.char in typecodes['AllInteger'])
 
-class TestGeom(NumpyTestCase):
-    def check_rvs(self):
+class TestGeom(TestCase):
+    def test_rvs(self):
         vals = stats.geom.rvs(0.75, size=(2, 50))
         assert(numpy.all(vals >= 0))
         assert(numpy.shape(vals) == (2, 50))
@@ -138,11 +135,11 @@
         assert(isinstance(val, numpy.ndarray))
         assert(val.dtype.char in typecodes['AllInteger'])
 
-    def check_pmf(self):
+    def test_pmf(self):
         vals = stats.geom.pmf([1,2,3],0.5)
         assert_array_almost_equal(vals,[0.5,0.25,0.125])
 
-    def check_cdf_sf(self):
+    def test_cdf_sf(self):
         vals = stats.geom.cdf([1,2,3],0.5)
         vals_sf = stats.geom.sf([1,2,3],0.5)
         expected = array([0.5,0.75,0.875])
@@ -150,8 +147,8 @@
         assert_array_almost_equal(vals_sf,1-expected)
 
 
-class TestHypergeom(NumpyTestCase):
-    def check_rvs(self):
+class TestHypergeom(TestCase):
+    def test_rvs(self):
         vals = stats.hypergeom.rvs(20, 10, 3, size=(2, 50))
         assert(numpy.all(vals >= 0) &
                numpy.all(vals <= 3))
@@ -161,8 +158,8 @@
         assert(isinstance(val, numpy.ndarray))
         assert(val.dtype.char in typecodes['AllInteger'])
 
-class TestLogser(NumpyTestCase):
-    def check_rvs(self):
+class TestLogser(TestCase):
+    def test_rvs(self):
         vals = stats.logser.rvs(0.75, size=(2, 50))
         assert(numpy.all(vals >= 1))
         assert(numpy.shape(vals) == (2, 50))
@@ -171,8 +168,8 @@
         assert(isinstance(val, numpy.ndarray))
         assert(val.dtype.char in typecodes['AllInteger'])
 
-class TestPoisson(NumpyTestCase):
-    def check_rvs(self):
+class TestPoisson(TestCase):
+    def test_rvs(self):
         vals = stats.poisson.rvs(0.5, size=(2, 50))
         assert(numpy.all(vals >= 0))
         assert(numpy.shape(vals) == (2, 50))
@@ -181,8 +178,8 @@
         assert(isinstance(val, numpy.ndarray))
         assert(val.dtype.char in typecodes['AllInteger'])
 
-class TestZipf(NumpyTestCase):
-    def check_rvs(self):
+class TestZipf(TestCase):
+    def test_rvs(self):
         vals = stats.zipf.rvs(1.5, size=(2, 50))
         assert(numpy.all(vals >= 1))
         assert(numpy.shape(vals) == (2, 50))
@@ -191,8 +188,8 @@
         assert(isinstance(val, numpy.ndarray))
         assert(val.dtype.char in typecodes['AllInteger'])
 
-class TestDLaplace(NumpyTestCase):
-    def check_rvs(self):
+class TestDLaplace(TestCase):
+    def test_rvs(self):
         vals = stats.dlaplace.rvs(1.5 , size=(2, 50))
         assert(numpy.shape(vals) == (2, 50))
         assert(vals.dtype.char in typecodes['AllInteger'])
@@ -200,8 +197,8 @@
         assert(isinstance(val, numpy.ndarray))
         assert(val.dtype.char in typecodes['AllInteger'])
 
-class TestRvDiscrete(NumpyTestCase):
-    def check_rvs(self):
+class TestRvDiscrete(TestCase):
+    def test_rvs(self):
         states = [-1,0,1,2,3,4]
         probability = [0.0,0.3,0.4,0.0,0.3,0.0]
         samples = 1000
@@ -211,9 +208,9 @@
         for s,p in zip(states,probability):
             assert abs(sum(x == s)/float(samples) - p) < 0.05
 
-class TestExpon(NumpyTestCase):
-    def check_zero(self):
+class TestExpon(TestCase):
+    def test_zero(self):
         assert_equal(stats.expon.pdf(0),1)
 
 if __name__ == "__main__":
-    NumpyTest('stats.distributions').run()
+    unittest.main()

Modified: trunk/scipy/stats/tests/test_morestats.py
===================================================================
--- trunk/scipy/stats/tests/test_morestats.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/tests/test_morestats.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,14 +1,11 @@
 # Author:  Travis Oliphant, 2002
 #
 
-from numpy.testing import *
+from scipy.testing import *
 
-set_package_path()
-import scipy
-import numpy
-import stats
-restore_path()
 
+import scipy.stats as stats
+
 import numpy as N
 from numpy.random import RandomState
 
@@ -23,49 +20,49 @@
 g9 = [1.002, 0.998, 0.996, 0.995, 0.996, 1.004, 1.004, 0.998, 0.999, 0.991]
 g10= [0.991, 0.995, 0.984, 0.994, 0.997, 0.997, 0.991, 0.998, 1.004, 0.997]
 
-class TestShapiro(NumpyTestCase):
-    def check_basic(self):
+class TestShapiro(TestCase):
+    def test_basic(self):
         x1 = [0.11,7.87,4.61,10.14,7.95,3.14,0.46,
               4.43,0.21,4.75,0.71,1.52,3.24,
               0.93,0.42,4.97,9.53,4.55,0.47,6.66]
-        w,pw = scipy.stats.shapiro(x1)
+        w,pw = stats.shapiro(x1)
         assert_almost_equal(w,0.90047299861907959,6)
         assert_almost_equal(pw,0.042089745402336121,6)
         x2 = [1.36,1.14,2.92,2.55,1.46,1.06,5.27,-1.11,
               3.48,1.10,0.88,-0.51,1.46,0.52,6.20,1.69,
               0.08,3.67,2.81,3.49]
-        w,pw = scipy.stats.shapiro(x2)
+        w,pw = stats.shapiro(x2)
         assert_almost_equal(w,0.9590270,6)
         assert_almost_equal(pw,0.52460,3)
 
-class TestAnderson(NumpyTestCase):
-    def check_normal(self):
+class TestAnderson(TestCase):
+    def test_normal(self):
         rs = RandomState(1234567890)
         x1 = rs.standard_exponential(size=50)
         x2 = rs.standard_normal(size=50)
-        A,crit,sig = scipy.stats.anderson(x1)
+        A,crit,sig = stats.anderson(x1)
         assert_array_less(crit[:-1], A)
-        A,crit,sig = scipy.stats.anderson(x2)
+        A,crit,sig = stats.anderson(x2)
         assert_array_less(A, crit[-2:])
 
-    def check_expon(self):
+    def test_expon(self):
         rs = RandomState(1234567890)
         x1 = rs.standard_exponential(size=50)
         x2 = rs.standard_normal(size=50)
-        A,crit,sig = scipy.stats.anderson(x1,'expon')
+        A,crit,sig = stats.anderson(x1,'expon')
         assert_array_less(A, crit[-2:])
-        A,crit,sig = scipy.stats.anderson(x2,'expon')
+        A,crit,sig = stats.anderson(x2,'expon')
         assert_array_less(crit[:-1], A)
 
-class TestAnsari(NumpyTestCase):
-    def check_small(self):
+class TestAnsari(TestCase):
+    def test_small(self):
         x = [1,2,3,3,4]
         y = [3,2,6,1,6,1,4,1]
         W, pval = stats.ansari(x,y)
         assert_almost_equal(W,23.5,11)
         assert_almost_equal(pval,0.13499256881897437,11)
 
-    def check_approx(self):
+    def test_approx(self):
         ramsay = N.array((111, 107, 100, 99, 102, 106, 109, 108, 104, 99,
                   101, 96, 97, 102, 107, 113, 116, 113, 110, 98))
         parekh = N.array((107, 108, 106, 98, 105, 103, 110, 105, 104,
@@ -74,13 +71,13 @@
         assert_almost_equal(W,185.5,11)
         assert_almost_equal(pval,0.18145819972867083,11)
 
-    def check_exact(self):
+    def test_exact(self):
         W,pval = stats.ansari([1,2,3,4],[15,5,20,8,10,12])
         assert_almost_equal(W,10.0,11)
         assert_almost_equal(pval,0.533333333333333333,7)
 
-class TestBartlett(NumpyTestCase):
-    def check_data(self):
+class TestBartlett(TestCase):
+    def test_data(self):
         args = []
         for k in range(1,11):
             args.append(eval('g%d'%k))
@@ -88,8 +85,8 @@
         assert_almost_equal(T,20.78587342806484,7)
         assert_almost_equal(pval,0.0136358632781,7)
 
-class TestLevene(NumpyTestCase):
-    def check_data(self):
+class TestLevene(TestCase):
+    def test_data(self):
         args = []
         for k in range(1,11):
             args.append(eval('g%d'%k))
@@ -97,8 +94,8 @@
         assert_almost_equal(W,1.7059176930008939,7)
         assert_almost_equal(pval,0.0990829755522,7)
 
-class TestBinomTest(NumpyTestCase):
-    def check_data(self):
+class TestBinomP(TestCase):
+    def test_data(self):
         pval = stats.binom_test(100,250)
         assert_almost_equal(pval,0.0018833009350757682,11)
         pval = stats.binom_test(201,405)
@@ -106,12 +103,12 @@
         pval = stats.binom_test([682,243],p=3.0/4)
         assert_almost_equal(pval,0.38249155957481695,11)
 
-class TestFindRepeats(NumpyTestCase):
-    def check_basic(self):
+class TestFindRepeats(TestCase):
+    def test_basic(self):
         a = [1,2,3,4,1,2,3,4,1,2,5]
-        res,nums = scipy.stats.find_repeats(a)
+        res,nums = stats.find_repeats(a)
         assert_array_equal(res,[1,2,3,4])
         assert_array_equal(nums,[3,3,2,2])
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/stats/tests/test_stats.py
===================================================================
--- trunk/scipy/stats/tests/test_stats.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/stats/tests/test_stats.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -7,15 +7,13 @@
 """
 
 import sys
-from numpy.testing import *
-from numpy import *
+from scipy.testing import *
+from numpy import array, arange, zeros, ravel, float32, float64, power
 import numpy
-import scipy
 
-set_package_path()
-import stats
-restore_path()
+import scipy.stats as stats
 
+
 """ Numbers in docstrings begining with 'W' refer to the section numbers
     and headings found in the STATISTICS QUIZ of Leland Wilkinson.  These are
     considered to be essential functionality.  True testing and
@@ -28,7 +26,7 @@
 ##  Datasets
 ##  These data sets are from the nasty.dat sets used by Wilkinson
 ##  for MISS, need to be able to represent missing values
-##  For completeness, I should write the relavant tests and count them as failures
+##  For completeness, I should write the relevant tests and count them as failures
 ##  Somewhat acceptable, since this is still beta software.  It would count as a
 ##  good target for 1.0 status
 X = array([1,2,3,4,5,6,7,8,9],float)
@@ -48,7 +46,7 @@
 X8 = X7 * X
 X9 = X8 * X
 
-class TestRound(NumpyTestCase):
+class TestRound(TestCase):
     """ W.II. ROUND
 
         You should get the numbers 1 to 9.  Many language compilers,
@@ -71,7 +69,7 @@
         statistical calculations.
     """
 
-    def check_rounding0(self):
+    def test_rounding0(self):
         """ W.II.A.0. Print ROUND with only one digit.
 
             You should get the numbers 1 to 9.  Many language compilers,
@@ -83,22 +81,22 @@
             y = round(ROUND[i])
             assert_equal(y,i+1)
 
-    def check_rounding1(self):
+    def test_rounding1(self):
         """ W.II.A.1. Y = INT(2.6*7 -0.2) (Y should be 18)"""
         y = int(2.6*7 -0.2)
         assert_equal(y, 18)
 
-    def check_rounding2(self):
+    def test_rounding2(self):
         """ W.II.A.2. Y = 2-INT(EXP(LOG(SQR(2)*SQR(2))))   (Y should be 0)"""
         y=2-int(numpy.exp(numpy.log(numpy.sqrt(2.)*numpy.sqrt(2.))))
         assert_equal(y,0)
 
-    def check_rounding3(self):
+    def test_rounding3(self):
         """ W.II.A.3. Y = INT(3-EXP(LOG(SQR(2)*SQR(2))))    (Y should be 1)"""
         y=(int(round((3-numpy.exp(numpy.log(numpy.sqrt(2.0)*numpy.sqrt(2.0)))))))
         assert_equal(y,1)
 
-class TestBasicStats(NumpyTestCase):
+class TestBasicStats(TestCase):
     """ W.II.C. Compute basic statistic on all the variables.
 
         The means should be the fifth value of all the variables (case FIVE).
@@ -107,86 +105,86 @@
         II. C. Basic Statistics
     """
 
-    def check_meanX(self):
-        y = scipy.stats.mean(X)
+    def test_meanX(self):
+        y = stats.mean(X)
         assert_almost_equal(y, 5.0)
 
-    def check_stdX(self):
-        y = scipy.stats.std(X)
+    def test_stdX(self):
+        y = stats.std(X)
         assert_almost_equal(y, 2.738612788)
 
-    def check_tmeanX(self):
-        y = scipy.stats.tmean(X, (2, 8), (True, True))
+    def test_tmeanX(self):
+        y = stats.tmean(X, (2, 8), (True, True))
         assert_almost_equal(y, 5.0)
 
-    def check_tvarX(self):
-        y = scipy.stats.tvar(X, (2, 8), (True, True))
+    def test_tvarX(self):
+        y = stats.tvar(X, (2, 8), (True, True))
         assert_almost_equal(y, 4.6666666666666661)
 
-    def check_tstdX(self):
-        y = scipy.stats.tstd(X, (2, 8), (True, True))
+    def test_tstdX(self):
+        y = stats.tstd(X, (2, 8), (True, True))
         assert_almost_equal(y, 2.1602468994692865)
 
-    def check_meanZERO(self):
-        y = scipy.stats.mean(ZERO)
+    def test_meanZERO(self):
+        y = stats.mean(ZERO)
         assert_almost_equal(y, 0.0)
 
-    def check_stdZERO(self):
-        y = scipy.stats.std(ZERO)
+    def test_stdZERO(self):
+        y = stats.std(ZERO)
         assert_almost_equal(y, 0.0)
 
 ##    Really need to write these tests to handle missing values properly
-##    def check_meanMISS(self):
-##        y = scipy.stats.mean(MISS)
+##    def test_meanMISS(self):
+##        y = stats.mean(MISS)
 ##        assert_almost_equal(y, 0.0)
 ##
-##    def check_stdMISS(self):
-##        y = scipy.stats.stdev(MISS)
+##    def test_stdMISS(self):
+##        y = stats.stdev(MISS)
 ##        assert_almost_equal(y, 0.0)
 
-    def check_meanBIG(self):
-        y = scipy.stats.mean(BIG)
+    def test_meanBIG(self):
+        y = stats.mean(BIG)
         assert_almost_equal(y, 99999995.00)
 
-    def check_stdBIG(self):
-        y = scipy.stats.std(BIG)
+    def test_stdBIG(self):
+        y = stats.std(BIG)
         assert_almost_equal(y, 2.738612788)
 
-    def check_meanLITTLE(self):
-        y = scipy.stats.mean(LITTLE)
+    def test_meanLITTLE(self):
+        y = stats.mean(LITTLE)
         assert_approx_equal(y, 0.999999950)
 
-    def check_stdLITTLE(self):
-        y = scipy.stats.std(LITTLE)
+    def test_stdLITTLE(self):
+        y = stats.std(LITTLE)
         assert_approx_equal(y, 2.738612788e-8)
 
-    def check_meanHUGE(self):
-        y = scipy.stats.mean(HUGE)
+    def test_meanHUGE(self):
+        y = stats.mean(HUGE)
         assert_approx_equal(y, 5.00000e+12)
 
-    def check_stdHUGE(self):
-        y = scipy.stats.std(HUGE)
+    def test_stdHUGE(self):
+        y = stats.std(HUGE)
         assert_approx_equal(y, 2.738612788e12)
 
-    def check_meanTINY(self):
-        y = scipy.stats.mean(TINY)
+    def test_meanTINY(self):
+        y = stats.mean(TINY)
         assert_almost_equal(y, 0.0)
 
-    def check_stdTINY(self):
-        y = scipy.stats.std(TINY)
+    def test_stdTINY(self):
+        y = stats.std(TINY)
         assert_almost_equal(y, 0.0)
 
-    def check_meanROUND(self):
-        y = scipy.stats.mean(ROUND)
+    def test_meanROUND(self):
+        y = stats.mean(ROUND)
         assert_approx_equal(y, 4.500000000)
 
-    def check_stdROUND(self):
-        y = scipy.stats.std(ROUND)
+    def test_stdROUND(self):
+        y = stats.std(ROUND)
         assert_approx_equal(y, 2.738612788)
 
-class TestNanFunc(NumpyTestCase):
+class TestNanFunc(TestCase):
     def __init__(self, *args, **kw):
-        NumpyTestCase.__init__(self, *args, **kw)
+        TestCase.__init__(self, *args, **kw)
         self.X = X.copy()
 
         self.Xall = X.copy()
@@ -197,52 +195,52 @@
         self.Xsome[0] = numpy.nan
         self.Xsomet = self.Xsomet[1:]
 
-    def check_nanmean_none(self):
+    def test_nanmean_none(self):
         """Check nanmean when no values are nan."""
         m = stats.stats.nanmean(X)
         assert_approx_equal(m, X[4])
 
-    def check_nanmean_some(self):
+    def test_nanmean_some(self):
         """Check nanmean when some values only are nan."""
         m = stats.stats.nanmean(self.Xsome)
         assert_approx_equal(m, 5.5)
 
-    def check_nanmean_all(self):
+    def test_nanmean_all(self):
         """Check nanmean when all values are nan."""
         m = stats.stats.nanmean(self.Xall)
         assert numpy.isnan(m)
 
-    def check_nanstd_none(self):
+    def test_nanstd_none(self):
         """Check nanstd when no values are nan."""
         s = stats.stats.nanstd(self.X)
         assert_approx_equal(s, stats.stats.std(self.X))
 
-    def check_nanstd_some(self):
+    def test_nanstd_some(self):
         """Check nanstd when some values only are nan."""
         s = stats.stats.nanstd(self.Xsome)
         assert_approx_equal(s, stats.stats.std(self.Xsomet))
 
-    def check_nanstd_all(self):
+    def test_nanstd_all(self):
         """Check nanstd when all values are nan."""
         s = stats.stats.nanstd(self.Xall)
         assert numpy.isnan(s)
 
-    def check_nanmedian_none(self):
+    def test_nanmedian_none(self):
         """Check nanmedian when no values are nan."""
         m = stats.stats.nanmedian(self.X)
         assert_approx_equal(m, stats.stats.median(self.X))
 
-    def check_nanmedian_some(self):
+    def test_nanmedian_some(self):
         """Check nanmedian when some values only are nan."""
         m = stats.stats.nanmedian(self.Xsome)
         assert_approx_equal(m, stats.stats.median(self.Xsomet))
 
-    def check_nanmedian_all(self):
+    def test_nanmedian_all(self):
         """Check nanmedian when all values are nan."""
         m = stats.stats.nanmedian(self.Xall)
         assert numpy.isnan(m)
 
-class TestCorr(NumpyTestCase):
+class TestCorr(TestCase):
     """ W.II.D. Compute a correlation matrix on all the variables.
 
         All the correlations, except for ZERO and MISS, shoud be exactly 1.
@@ -250,172 +248,172 @@
         other variables.  The same should go for SPEARMAN corelations, if
         your program has them.
     """
-    def check_pXX(self):
-        y = scipy.stats.pearsonr(X,X)
+    def test_pXX(self):
+        y = stats.pearsonr(X,X)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pXBIG(self):
-        y = scipy.stats.pearsonr(X,BIG)
+    def test_pXBIG(self):
+        y = stats.pearsonr(X,BIG)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pXLITTLE(self):
-        y = scipy.stats.pearsonr(X,LITTLE)
+    def test_pXLITTLE(self):
+        y = stats.pearsonr(X,LITTLE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pXHUGE(self):
-        y = scipy.stats.pearsonr(X,HUGE)
+    def test_pXHUGE(self):
+        y = stats.pearsonr(X,HUGE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pXTINY(self):
-        y = scipy.stats.pearsonr(X,TINY)
+    def test_pXTINY(self):
+        y = stats.pearsonr(X,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pXROUND(self):
-        y = scipy.stats.pearsonr(X,ROUND)
+    def test_pXROUND(self):
+        y = stats.pearsonr(X,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pBIGBIG(self):
-        y = scipy.stats.pearsonr(BIG,BIG)
+    def test_pBIGBIG(self):
+        y = stats.pearsonr(BIG,BIG)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pBIGLITTLE(self):
-        y = scipy.stats.pearsonr(BIG,LITTLE)
+    def test_pBIGLITTLE(self):
+        y = stats.pearsonr(BIG,LITTLE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pBIGHUGE(self):
-        y = scipy.stats.pearsonr(BIG,HUGE)
+    def test_pBIGHUGE(self):
+        y = stats.pearsonr(BIG,HUGE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pBIGTINY(self):
-        y = scipy.stats.pearsonr(BIG,TINY)
+    def test_pBIGTINY(self):
+        y = stats.pearsonr(BIG,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pBIGROUND(self):
-        y = scipy.stats.pearsonr(BIG,ROUND)
+    def test_pBIGROUND(self):
+        y = stats.pearsonr(BIG,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pLITTLELITTLE(self):
-        y = scipy.stats.pearsonr(LITTLE,LITTLE)
+    def test_pLITTLELITTLE(self):
+        y = stats.pearsonr(LITTLE,LITTLE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pLITTLEHUGE(self):
-        y = scipy.stats.pearsonr(LITTLE,HUGE)
+    def test_pLITTLEHUGE(self):
+        y = stats.pearsonr(LITTLE,HUGE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pLITTLETINY(self):
-        y = scipy.stats.pearsonr(LITTLE,TINY)
+    def test_pLITTLETINY(self):
+        y = stats.pearsonr(LITTLE,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pLITTLEROUND(self):
-        y = scipy.stats.pearsonr(LITTLE,ROUND)
+    def test_pLITTLEROUND(self):
+        y = stats.pearsonr(LITTLE,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pHUGEHUGE(self):
-        y = scipy.stats.pearsonr(HUGE,HUGE)
+    def test_pHUGEHUGE(self):
+        y = stats.pearsonr(HUGE,HUGE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pHUGETINY(self):
-        y = scipy.stats.pearsonr(HUGE,TINY)
+    def test_pHUGETINY(self):
+        y = stats.pearsonr(HUGE,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pHUGEROUND(self):
-        y = scipy.stats.pearsonr(HUGE,ROUND)
+    def test_pHUGEROUND(self):
+        y = stats.pearsonr(HUGE,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pTINYTINY(self):
-        y = scipy.stats.pearsonr(TINY,TINY)
+    def test_pTINYTINY(self):
+        y = stats.pearsonr(TINY,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pTINYROUND(self):
-        y = scipy.stats.pearsonr(TINY,ROUND)
+    def test_pTINYROUND(self):
+        y = stats.pearsonr(TINY,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_pROUNDROUND(self):
-        y = scipy.stats.pearsonr(ROUND,ROUND)
+    def test_pROUNDROUND(self):
+        y = stats.pearsonr(ROUND,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sXX(self):
-        y = scipy.stats.spearmanr(X,X)
+    def test_sXX(self):
+        y = stats.spearmanr(X,X)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sXBIG(self):
-        y = scipy.stats.spearmanr(X,BIG)
+    def test_sXBIG(self):
+        y = stats.spearmanr(X,BIG)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sXLITTLE(self):
-        y = scipy.stats.spearmanr(X,LITTLE)
+    def test_sXLITTLE(self):
+        y = stats.spearmanr(X,LITTLE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sXHUGE(self):
-        y = scipy.stats.spearmanr(X,HUGE)
+    def test_sXHUGE(self):
+        y = stats.spearmanr(X,HUGE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sXTINY(self):
-        y = scipy.stats.spearmanr(X,TINY)
+    def test_sXTINY(self):
+        y = stats.spearmanr(X,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sXROUND(self):
-        y = scipy.stats.spearmanr(X,ROUND)
+    def test_sXROUND(self):
+        y = stats.spearmanr(X,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sBIGBIG(self):
-        y = scipy.stats.spearmanr(BIG,BIG)
+    def test_sBIGBIG(self):
+        y = stats.spearmanr(BIG,BIG)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sBIGLITTLE(self):
-        y = scipy.stats.spearmanr(BIG,LITTLE)
+    def test_sBIGLITTLE(self):
+        y = stats.spearmanr(BIG,LITTLE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sBIGHUGE(self):
-        y = scipy.stats.spearmanr(BIG,HUGE)
+    def test_sBIGHUGE(self):
+        y = stats.spearmanr(BIG,HUGE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sBIGTINY(self):
-        y = scipy.stats.spearmanr(BIG,TINY)
+    def test_sBIGTINY(self):
+        y = stats.spearmanr(BIG,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sBIGROUND(self):
-        y = scipy.stats.spearmanr(BIG,ROUND)
+    def test_sBIGROUND(self):
+        y = stats.spearmanr(BIG,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sLITTLELITTLE(self):
-        y = scipy.stats.spearmanr(LITTLE,LITTLE)
+    def test_sLITTLELITTLE(self):
+        y = stats.spearmanr(LITTLE,LITTLE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sLITTLEHUGE(self):
-        y = scipy.stats.spearmanr(LITTLE,HUGE)
+    def test_sLITTLEHUGE(self):
+        y = stats.spearmanr(LITTLE,HUGE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sLITTLETINY(self):
-        y = scipy.stats.spearmanr(LITTLE,TINY)
+    def test_sLITTLETINY(self):
+        y = stats.spearmanr(LITTLE,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sLITTLEROUND(self):
-        y = scipy.stats.spearmanr(LITTLE,ROUND)
+    def test_sLITTLEROUND(self):
+        y = stats.spearmanr(LITTLE,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sHUGEHUGE(self):
-        y = scipy.stats.spearmanr(HUGE,HUGE)
+    def test_sHUGEHUGE(self):
+        y = stats.spearmanr(HUGE,HUGE)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sHUGETINY(self):
-        y = scipy.stats.spearmanr(HUGE,TINY)
+    def test_sHUGETINY(self):
+        y = stats.spearmanr(HUGE,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sHUGEROUND(self):
-        y = scipy.stats.spearmanr(HUGE,ROUND)
+    def test_sHUGEROUND(self):
+        y = stats.spearmanr(HUGE,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sTINYTINY(self):
-        y = scipy.stats.spearmanr(TINY,TINY)
+    def test_sTINYTINY(self):
+        y = stats.spearmanr(TINY,TINY)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sTINYROUND(self):
-        y = scipy.stats.spearmanr(TINY,ROUND)
+    def test_sTINYROUND(self):
+        y = stats.spearmanr(TINY,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
-    def check_sROUNDROUND(self):
-        y = scipy.stats.spearmanr(ROUND,ROUND)
+    def test_sROUNDROUND(self):
+        y = stats.spearmanr(ROUND,ROUND)
         r = y[0]
         assert_approx_equal(r,1.0)
 
@@ -429,13 +427,13 @@
 ### I need to figure out how to do this one.
 
 
-class TestRegression(NumpyTestCase):
-    def check_linregressBIGX(self):
+class TestRegression(TestCase):
+    def test_linregressBIGX(self):
         """ W.II.F.  Regress BIG on X.
 
             The constant should be 99999990 and the regression coefficient should be 1.
         """
-        y = scipy.stats.linregress(X,BIG)
+        y = stats.linregress(X,BIG)
         intercept = y[1]
         r=y[2]
         assert_almost_equal(intercept,99999990)
@@ -453,13 +451,13 @@
 ##     The datasets X1 . . X9 are at the top of the file.
 
 
-    def check_regressXX(self):
+    def test_regressXX(self):
         """ W.IV.B.  Regress X on X.
 
             The constant should be exactly 0 and the regression coefficient should be 1.
             This is a perfectly valid regression.  The program should not complain.
         """
-        y = scipy.stats.linregress(X,X)
+        y = stats.linregress(X,X)
         intercept = y[1]
         r=y[2]
         assert_almost_equal(intercept,0.0)
@@ -471,14 +469,14 @@
 ##     fundamental regression error.
 ### Need to figure out how to handle multiple linear regression.  Not obvious
 
-    def check_regressZEROX(self):
+    def test_regressZEROX(self):
         """ W.IV.D. Regress ZERO on X.
 
             The program should inform you that ZERO has no variance or it should
             go ahead and compute the regression and report a correlation and
             total sum of squares of exactly 0.
         """
-        y = scipy.stats.linregress(X,ZERO)
+        y = stats.linregress(X,ZERO)
         intercept = y[1]
         r=y[2]
         assert_almost_equal(intercept,0.0)
@@ -494,9 +492,9 @@
 ##################################################
 ### Test for sum
 
-class TestGMean(NumpyTestCase):
+class TestGMean(TestCase):
 
-    def check_1D_list(self):
+    def test_1D_list(self):
         a = (1,2,3,4)
         actual= stats.gmean(a)
         desired = power(1*2*3*4,1./4.)
@@ -505,7 +503,7 @@
         desired1 = stats.gmean(a,axis=-1)
         assert_almost_equal(actual, desired1, decimal=14)
 
-    def check_1D_array(self):
+    def test_1D_array(self):
         a = array((1,2,3,4), float32)
         actual= stats.gmean(a)
         desired = power(1*2*3*4,1./4.)
@@ -514,7 +512,7 @@
         desired1 = stats.gmean(a,axis=-1)
         assert_almost_equal(actual, desired1, decimal=7)
 
-    def check_2D_array_default(self):
+    def test_2D_array_default(self):
         a = array(((1,2,3,4),
                    (1,2,3,4),
                    (1,2,3,4)))
@@ -525,7 +523,7 @@
         desired1 = stats.gmean(a,axis=0)
         assert_array_almost_equal(actual, desired1, decimal=14)
 
-    def check_2D_array_dim1(self):
+    def test_2D_array_dim1(self):
         a = array(((1,2,3,4),
                    (1,2,3,4),
                    (1,2,3,4)))
@@ -534,13 +532,13 @@
         desired = array((v,v,v))
         assert_array_almost_equal(actual, desired, decimal=14)
 
-    def check_large_values(self):
+    def test_large_values(self):
         a = array([1e100, 1e200, 1e300])
         actual = stats.gmean(a)
         assert_approx_equal(actual, 1e200, significant=14)
 
-class TestHMean(NumpyTestCase):
-    def check_1D_list(self):
+class TestHMean(TestCase):
+    def test_1D_list(self):
         a = (1,2,3,4)
         actual= stats.hmean(a)
         desired =  4. / (1./1 + 1./2 + 1./3 + 1./4)
@@ -548,7 +546,7 @@
 
         desired1 = stats.hmean(array(a),axis=-1)
         assert_almost_equal(actual, desired1, decimal=14)
-    def check_1D_array(self):
+    def test_1D_array(self):
         a = array((1,2,3,4), float64)
         actual= stats.hmean(a)
         desired =  4. / (1./1 + 1./2 + 1./3 + 1./4)
@@ -557,7 +555,7 @@
         desired1 = stats.hmean(a,axis=-1)
         assert_almost_equal(actual, desired1, decimal=14)
 
-    def check_2D_array_default(self):
+    def test_2D_array_default(self):
         a = array(((1,2,3,4),
                    (1,2,3,4),
                    (1,2,3,4)))
@@ -568,7 +566,7 @@
         actual1 = stats.hmean(a,axis=0)
         assert_array_almost_equal(actual1, desired, decimal=14)
 
-    def check_2D_array_dim1(self):
+    def test_2D_array_dim1(self):
         a = array(((1,2,3,4),
                    (1,2,3,4),
                    (1,2,3,4)))
@@ -579,8 +577,8 @@
         assert_array_almost_equal(actual1, desired1, decimal=14)
 
 
-class TestMean(NumpyTestCase):
-    def check_basic(self):
+class TestMean(TestCase):
+    def test_basic(self):
         a = [3,4,5,10,-3,-5,6]
         af = [3.,4,5,10,-3,-5,-6]
         Na = len(a)
@@ -594,7 +592,7 @@
             mn2 += el / float(Naf)
         assert_almost_equal(stats.mean(af),mn2,11)
 
-    def check_2d(self):
+    def test_2d(self):
         a = [[1.0, 2.0, 3.0],
              [2.0, 4.0, 6.0],
              [8.0, 12.0, 7.0]]
@@ -611,15 +609,15 @@
         mn2 /= N2
         assert_almost_equal(stats.mean(a, axis=1), mn2, decimal=13)
 
-    def check_ravel(self):
+    def test_ravel(self):
         a = rand(5,3,5)
         A = 0
         for val in ravel(a):
             A += val
         assert_almost_equal(stats.mean(a,axis=None),A/(5*3.0*5))
 
-class TestMedian(NumpyTestCase):
-    def check_basic(self):
+class TestMedian(TestCase):
+    def test_basic(self):
         a1 = [3,4,5,10,-3,-5,6]
         a2 = [3,-6,-2,8,7,4,2,1]
         a3 = [3.,4,5,10,-3,-5,-6,7.0]
@@ -627,18 +625,18 @@
         assert_equal(stats.median(a2),2.5)
         assert_equal(stats.median(a3),3.5)
 
-class TestPercentile(NumpyTestCase):
+class TestPercentile(TestCase):
     def setUp(self):
         self.a1 = [3,4,5,10,-3,-5,6]
         self.a2 = [3,-6,-2,8,7,4,2,1]
         self.a3 = [3.,4,5,10,-3,-5,-6,7.0]
 
-    def check_median(self):
+    def test_median(self):
         assert_equal(stats.median(self.a1), 4)
         assert_equal(stats.median(self.a2), 2.5)
         assert_equal(stats.median(self.a3), 3.5)
 
-    def check_percentile(self):
+    def test_percentile(self):
         x = arange(8) * 0.5
         assert_equal(stats.scoreatpercentile(x, 0), 0.)
         assert_equal(stats.scoreatpercentile(x, 100), 3.5)
@@ -654,14 +652,14 @@
                            [1,1,1])
 
 
-class TestStd(NumpyTestCase):
-    def check_basic(self):
+class TestStd(TestCase):
+    def test_basic(self):
         a = [3,4,5,10,-3,-5,6]
         b = [3,4,5,10,-3,-5,-6]
         assert_almost_equal(stats.std(a),5.2098807225172772,11)
         assert_almost_equal(stats.std(b),5.9281411203561225,11)
 
-    def check_2d(self):
+    def test_2d(self):
         a = [[1.0, 2.0, 3.0],
              [2.0, 4.0, 6.0],
              [8.0, 12.0, 7.0]]
@@ -673,109 +671,109 @@
         assert_array_almost_equal(stats.std(a,axis=1),b2,11)
 
 
-class TestCMedian(NumpyTestCase):
-    def check_basic(self):
+class TestCMedian(TestCase):
+    def test_basic(self):
         data = [1,2,3,1,5,3,6,4,3,2,4,3,5,2.0]
         assert_almost_equal(stats.cmedian(data,5),3.2916666666666665)
         assert_almost_equal(stats.cmedian(data,3),3.083333333333333)
         assert_almost_equal(stats.cmedian(data),3.0020020020020022)
 
-class TestMedian(NumpyTestCase):
-    def check_basic(self):
+class TestMedian(TestCase):
+    def test_basic(self):
         data1 = [1,3,5,2,3,1,19,-10,2,4.0]
         data2 = [3,5,1,10,23,-10,3,-2,6,8,15]
         assert_almost_equal(stats.median(data1),2.5)
         assert_almost_equal(stats.median(data2),5)
 
-class TestMode(NumpyTestCase):
-    def check_basic(self):
+class TestMode(TestCase):
+    def test_basic(self):
         data1 = [3,5,1,10,23,3,2,6,8,6,10,6]
         vals = stats.mode(data1)
         assert_almost_equal(vals[0][0],6)
         assert_almost_equal(vals[1][0],3)
 
 
-class TestVariability(NumpyTestCase):
+class TestVariability(TestCase):
     """  Comparison numbers are found using R v.1.5.1
          note that length(testcase) = 4
     """
     testcase = [1,2,3,4]
-    def check_std(self):
-        y = scipy.stats.std(self.testcase)
+    def test_std(self):
+        y = stats.std(self.testcase)
         assert_approx_equal(y,1.290994449)
 
-    def check_var(self):
+    def test_var(self):
         """
         var(testcase) = 1.666666667 """
-        #y = scipy.stats.var(self.shoes[0])
+        #y = stats.var(self.shoes[0])
         #assert_approx_equal(y,6.009)
-        y = scipy.stats.var(self.testcase)
+        y = stats.var(self.testcase)
         assert_approx_equal(y,1.666666667)
 
-    def check_samplevar(self):
+    def test_samplevar(self):
         """
         R does not have 'samplevar' so the following was used
         var(testcase)*(4-1)/4  where 4 = length(testcase)
         """
-        #y = scipy.stats.samplevar(self.shoes[0])
+        #y = stats.samplevar(self.shoes[0])
         #assert_approx_equal(y,5.4081)
-        y = scipy.stats.samplevar(self.testcase)
+        y = stats.samplevar(self.testcase)
         assert_approx_equal(y,1.25)
 
-    def check_samplestd(self):
-        #y = scipy.stats.samplestd(self.shoes[0])
+    def test_samplestd(self):
+        #y = stats.samplestd(self.shoes[0])
         #assert_approx_equal(y,2.325532197)
-        y = scipy.stats.samplestd(self.testcase)
+        y = stats.samplestd(self.testcase)
         assert_approx_equal(y,1.118033989)
 
-    def check_signaltonoise(self):
+    def test_signaltonoise(self):
         """
         this is not in R, so used
         mean(testcase,axis=0)/(sqrt(var(testcase)*3/4)) """
-        #y = scipy.stats.signaltonoise(self.shoes[0])
+        #y = stats.signaltonoise(self.shoes[0])
         #assert_approx_equal(y,4.5709967)
-        y = scipy.stats.signaltonoise(self.testcase)
+        y = stats.signaltonoise(self.testcase)
         assert_approx_equal(y,2.236067977)
 
-    def check_stderr(self):
+    def test_stderr(self):
         """
         this is not in R, so used
         sqrt(var(testcase))/sqrt(4)
         """
-##        y = scipy.stats.stderr(self.shoes[0])
+##        y = stats.stderr(self.shoes[0])
 ##        assert_approx_equal(y,0.775177399)
-        y = scipy.stats.stderr(self.testcase)
+        y = stats.stderr(self.testcase)
         assert_approx_equal(y,0.6454972244)
-    def check_sem(self):
+    def test_sem(self):
         """
         this is not in R, so used
         sqrt(var(testcase)*3/4)/sqrt(3)
         """
-        #y = scipy.stats.sem(self.shoes[0])
+        #y = stats.sem(self.shoes[0])
         #assert_approx_equal(y,0.775177399)
-        y = scipy.stats.sem(self.testcase)
+        y = stats.sem(self.testcase)
         assert_approx_equal(y,0.6454972244)
 
-    def check_z(self):
+    def test_z(self):
         """
         not in R, so used
         (10-mean(testcase,axis=0))/sqrt(var(testcase)*3/4)
         """
-        y = scipy.stats.z(self.testcase,scipy.stats.mean(self.testcase))
+        y = stats.z(self.testcase,stats.mean(self.testcase))
         assert_almost_equal(y,0.0)
 
-    def check_zs(self):
+    def test_zs(self):
         """
         not in R, so tested by using
         (testcase[i]-mean(testcase,axis=0))/sqrt(var(testcase)*3/4)
         """
-        y = scipy.stats.zs(self.testcase)
+        y = stats.zs(self.testcase)
         desired = ([-1.3416407864999, -0.44721359549996 , 0.44721359549996 , 1.3416407864999])
         assert_array_almost_equal(desired,y,decimal=12)
 
 
 
-class TestMoments(NumpyTestCase):
+class TestMoments(TestCase):
     """
         Comparison numbers are found using R v.1.5.1
         note that length(testcase) = 4
@@ -787,56 +785,56 @@
     """
     testcase = [1,2,3,4]
     testmathworks = [1.165 , 0.6268, 0.0751, 0.3516, -0.6965]
-    def check_moment(self):
+    def test_moment(self):
         """
         mean((testcase-mean(testcase))**power,axis=0),axis=0))**power))"""
-        y = scipy.stats.moment(self.testcase,1)
+        y = stats.moment(self.testcase,1)
         assert_approx_equal(y,0.0,10)
-        y = scipy.stats.moment(self.testcase,2)
+        y = stats.moment(self.testcase,2)
         assert_approx_equal(y,1.25)
-        y = scipy.stats.moment(self.testcase,3)
+        y = stats.moment(self.testcase,3)
         assert_approx_equal(y,0.0)
-        y = scipy.stats.moment(self.testcase,4)
+        y = stats.moment(self.testcase,4)
         assert_approx_equal(y,2.5625)
-    def check_variation(self):
+    def test_variation(self):
         """
         variation = samplestd/mean """
-##        y = scipy.stats.variation(self.shoes[0])
+##        y = stats.variation(self.shoes[0])
 ##        assert_approx_equal(y,21.8770668)
-        y = scipy.stats.variation(self.testcase)
+        y = stats.variation(self.testcase)
         assert_approx_equal(y,0.44721359549996, 10)
 
-    def check_skewness(self):
+    def test_skewness(self):
         """
             sum((testmathworks-mean(testmathworks,axis=0))**3,axis=0)/((sqrt(var(testmathworks)*4/5))**3)/5
         """
-        y = scipy.stats.skew(self.testmathworks)
+        y = stats.skew(self.testmathworks)
         assert_approx_equal(y,-0.29322304336607,10)
-        y = scipy.stats.skew(self.testmathworks,bias=0)
+        y = stats.skew(self.testmathworks,bias=0)
         assert_approx_equal(y,-0.437111105023940,10)
-        y = scipy.stats.skew(self.testcase)
+        y = stats.skew(self.testcase)
         assert_approx_equal(y,0.0,10)
-    def check_kurtosis(self):
+    def test_kurtosis(self):
         """
             sum((testcase-mean(testcase,axis=0))**4,axis=0)/((sqrt(var(testcase)*3/4))**4)/4
             sum((test2-mean(testmathworks,axis=0))**4,axis=0)/((sqrt(var(testmathworks)*4/5))**4)/5
             Set flags for axis = 0 and
             fisher=0 (Pearson's defn of kurtosis for compatiability with Matlab)
         """
-        y = scipy.stats.kurtosis(self.testmathworks,0,fisher=0,bias=1)
+        y = stats.kurtosis(self.testmathworks,0,fisher=0,bias=1)
         assert_approx_equal(y, 2.1658856802973,10)
 
         # Note that MATLAB has confusing docs for the following case
         #  kurtosis(x,0) gives an unbiased estimate of Pearson's skewness
         #  kurtosis(x)  gives a biased estimate of Fisher's skewness (Pearson-3)
         #  The MATLAB docs imply that both should give Fisher's
-        y = scipy.stats.kurtosis(self.testmathworks,fisher=0,bias=0)
+        y = stats.kurtosis(self.testmathworks,fisher=0,bias=0)
         assert_approx_equal(y, 3.663542721189047,10)
-        y = scipy.stats.kurtosis(self.testcase,0,0)
+        y = stats.kurtosis(self.testcase,0,0)
         assert_approx_equal(y,1.64)
 
-class TestThreshold(NumpyTestCase):
-    def check_basic(self):
+class TestThreshold(TestCase):
+    def test_basic(self):
         a = [-1,2,3,4,5,-1,-2]
         assert_array_equal(stats.threshold(a),a)
         assert_array_equal(stats.threshold(a,3,None,0),
@@ -847,4 +845,4 @@
                            [0,2,3,4,0,0,0])
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/testing/nosetester.py
===================================================================
--- trunk/scipy/testing/nosetester.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/testing/nosetester.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -17,7 +17,7 @@
             package = f.f_locals.get('__file__', None)
             assert package is not None
             package = os.path.dirname(package)
-        else isinstance(package, type(os)):
+        elif isinstance(package, type(os)):
             package = os.path.dirname(package.__file__)
         self.package_path = package
         

Modified: trunk/scipy/weave/__init__.py
===================================================================
--- trunk/scipy/weave/__init__.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/__init__.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -18,5 +18,5 @@
 except:
     pass
 
-from numpy.testing import NumpyTest
-test = NumpyTest().test
+from scipy.testing.pkgtester import Tester
+test = Tester().test

Modified: trunk/scipy/weave/c_spec.py
===================================================================
--- trunk/scipy/weave/c_spec.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/c_spec.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -455,10 +455,6 @@
     def type_match(self,value):
         return 1
 
-def test(level=10,verbosity=1):
-    from numpy.testing import NumpyTest
-    NumpyTest().test(level, verbosity)
-
 if __name__ == "__main__":
     x = list_converter().type_spec("x",1)
     print x.py_to_c_code()

Modified: trunk/scipy/weave/size_check.py
===================================================================
--- trunk/scipy/weave/size_check.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/size_check.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -279,5 +279,3 @@
 def take(ary,axis=0): raise NotImplemented
 # and all the rest
 
-#from numpy.testing import NumpyTest
-#test = NumpyTest().test

Modified: trunk/scipy/weave/tests/test_ast_tools.py
===================================================================
--- trunk/scipy/weave/tests/test_ast_tools.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_ast_tools.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,31 +1,29 @@
+from scipy.testing import *
 
-from numpy.testing import *
-set_package_path()
-from weave import ast_tools
-restore_path()
+from scipy.weave import ast_tools
 
 set_local_path()
 from weave_test_utils import *
 restore_path()
 
-class TestHarvestVariables(NumpyTestCase):
+class TestHarvestVariables(TestCase):
     """ Not much testing going on here, but
         at least it is a flame test.
     """
-    def generic_test(self,expr,desired):
+    def generic_check(self,expr,desired):
         import parser
         ast_list = parser.suite(expr).tolist()
         actual = ast_tools.harvest_variables(ast_list)
         print_assert_equal(expr,actual,desired)
 
-    def check_simple_expr(self):
+    def test_simple_expr(self):
         """convert simple expr to blitz
 
            a[:1:2] = b[:1+i+2:]
         """
         expr = "a[:1:2] = b[:1+i+2:]"
         desired = ['a','b','i']
-        self.generic_test(expr,desired)
+        self.generic_check(expr,desired)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_blitz_tools.py
===================================================================
--- trunk/scipy/weave/tests/test_blitz_tools.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_blitz_tools.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,22 +1,22 @@
 import os
 import time
 
-from numpy import *
+from numpy import dot, float32, float64, complex64, complex128, \
+     zeros, random, array, sum, abs, allclose
 
-from numpy.testing import *
-set_package_path()
-from weave import blitz_tools
-from weave.ast_tools import harvest_variables
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import blitz_tools
+from scipy.weave.ast_tools import harvest_variables
+
 set_local_path()
 from weave_test_utils import *
 restore_path()
 
 
-class TestAstToBlitzExpr(NumpyTestCase):
+class TestAstToBlitzExpr(TestCase):
 
-    def generic_test(self,expr,desired):
+    def generic_check(self,expr,desired):
         import parser
         ast = parser.suite(expr)
         ast_list = ast.tolist()
@@ -25,7 +25,7 @@
         desired = remove_whitespace(desired)
         print_assert_equal(expr,actual,desired)
 
-    def check_simple_expr(self):
+    def test_simple_expr(self):
         """convert simple expr to blitz
 
            a[:1:2] = b[:1+i+2:]
@@ -33,9 +33,9 @@
         expr = "a[:1:2] = b[:1+i+2:]"
         desired = "a(blitz::Range(_beg,1-1,2))="\
                   "b(blitz::Range(_beg,1+i+2-1));"
-        self.generic_test(expr,desired)
+        self.generic_check(expr,desired)
 
-    def check_fdtd_expr(self):
+    def test_fdtd_expr(self):
         """ convert fdtd equation to blitz.
              ex[:,1:,1:] =   ca_x[:,1:,1:] * ex[:,1:,1:]
                            + cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,:])
@@ -55,14 +55,14 @@
                   ' -cb_z_x(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\
                   '*(hy(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\
                   '-hy(_all,blitz::Range(1,_end),blitz::Range(_beg,Nhy(2)-1-1)));'
-        self.generic_test(expr,desired)
+        self.generic_check(expr,desired)
 
-class TestBlitz(NumpyTestCase):
+class TestBlitz(TestCase):
     """* These are long running tests...
 
          I'd like to benchmark these things somehow.
     *"""
-    def generic_test(self,expr,arg_dict,type,size,mod_location):
+    def generic_check(self,expr,arg_dict,type,size,mod_location):
         clean_result = array(arg_dict['result'],copy=1)
         t1 = time.time()
         exec expr in globals(),arg_dict
@@ -113,7 +113,7 @@
                 try:     arg_dict[arg].imag = arg_dict[arg].real
                 except:  pass
             print 'Run:', size,typ
-            standard,compiled = self.generic_test(expr,arg_dict,type,size,
+            standard,compiled = self.generic_check(expr,arg_dict,type,size,
                                                   mod_location)
             try:
                 speed_up = standard/compiled
@@ -121,7 +121,7 @@
                 speed_up = -1.
             print "1st run(numpy.numerix,compiled,speed up):  %3.4f, %3.4f, " \
                   "%3.4f" % (standard,compiled,speed_up)
-            standard,compiled = self.generic_test(expr,arg_dict,type,size,
+            standard,compiled = self.generic_check(expr,arg_dict,type,size,
                                                   mod_location)
             try:
                 speed_up = standard/compiled
@@ -130,25 +130,30 @@
             print "2nd run(numpy.numerix,compiled,speed up):  %3.4f, %3.4f, " \
                   "%3.4f" % (standard,compiled,speed_up)
         cleanup_temp_dir(mod_location)
-    #def check_simple_2d(self):
+    #def test_simple_2d(self):
     #    """ result = a + b"""
     #    expr = "result = a + b"
     #    self.generic_2d(expr)
-    def check_5point_avg_2d_float(self,level=10):
+    @dec.slow
+    def test_5point_avg_2d_float(self):
         """ result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]
                                + b[1:-1,2:] + b[1:-1,:-2]) / 5.
         """
         expr = "result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]" \
                                   "+ b[1:-1,2:] + b[1:-1,:-2]) / 5."
         self.generic_2d(expr,float32)
-    def check_5point_avg_2d_double(self,level=10):
+        
+    @dec.slow
+    def test_5point_avg_2d_double(self):
         """ result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]
                                + b[1:-1,2:] + b[1:-1,:-2]) / 5.
         """
         expr = "result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]" \
                                   "+ b[1:-1,2:] + b[1:-1,:-2]) / 5."
         self.generic_2d(expr,float64)
-    def _check_5point_avg_2d_complex_float(self,level=10):
+
+    @dec.slow
+    def _check_5point_avg_2d_complex_float(self):
         """ Note: THIS TEST is KNOWN TO FAIL ON GCC 3.x.  It will not adversely affect 99.99 percent of weave
 
             result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]
@@ -165,7 +170,9 @@
         expr = "result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]" \
                                   "+ b[1:-1,2:] + b[1:-1,:-2]) / 5."
         self.generic_2d(expr,complex64)
-    def check_5point_avg_2d_complex_double(self,level=10):
+
+    @dec.slow
+    def test_5point_avg_2d_complex_double(self):
         """ result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]
                                + b[1:-1,2:] + b[1:-1,:-2]) / 5.
         """
@@ -174,4 +181,4 @@
         self.generic_2d(expr,complex128)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_build_tools.py
===================================================================
--- trunk/scipy/weave/tests/test_build_tools.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_build_tools.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,34 +4,33 @@
 
 import os, sys, tempfile
 
-from numpy.testing import *
-set_package_path()
-from weave import build_tools
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import build_tools
+
 def is_writable(val):
     return os.access(val,os.W_OK)
 
-class TestConfigureBuildDir(NumpyTestCase):
-    def check_default(self):
+class TestConfigureBuildDir(TestCase):
+    def test_default(self):
         " default behavior is to return current directory "
         d = build_tools.configure_build_dir()
         if is_writable('.'):
             assert(d == os.path.abspath('.'))
         assert(is_writable(d))
-    def check_curdir(self):
+    def test_curdir(self):
         " make sure it handles relative values. "
         d = build_tools.configure_build_dir('.')
         if is_writable('.'):
             assert(d == os.path.abspath('.'))
         assert(is_writable(d))
-    def check_pardir(self):
+    def test_pardir(self):
         " make sure it handles relative values "
         d = build_tools.configure_build_dir('..')
         if is_writable('..'):
             assert(d == os.path.abspath('..'))
         assert(is_writable(d))
-    def check_bad_path(self):
+    def test_bad_path(self):
         " bad path should return same as default (and warn) "
         d = build_tools.configure_build_dir('_bad_path_')
         d2 = build_tools.configure_build_dir()
@@ -39,15 +38,15 @@
         assert(is_writable(d))
 
 class TestConfigureTempDir(TestConfigureBuildDir):
-    def check_default(self):
+    def test_default(self):
         " default behavior returns tempdir"
         # this'll fail if the temp directory isn't writable.
         d = build_tools.configure_temp_dir()
         assert(d == tempfile.gettempdir())
         assert(is_writable(d))
 
-class TestConfigureSysArgv(NumpyTestCase):
-    def check_simple(self):
+class TestConfigureSysArgv(TestCase):
+    def test_simple(self):
         build_dir = 'build_dir'
         temp_dir = 'temp_dir'
         compiler = 'compiler'
@@ -63,4 +62,4 @@
         assert(pre_argv == sys.argv[:])
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_c_spec.py
===================================================================
--- trunk/scipy/weave/tests/test_c_spec.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_c_spec.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -3,19 +3,17 @@
 import sys
 
 # Note: test_dir is global to this file.
-#       It is made by setup_test_location()
+#       It is made by setup_location()
 
 #globals
 global test_dir
 test_dir = ''
 
-from numpy.testing import *
-set_package_path()
-from weave import inline_tools,ext_tools,c_spec
-from weave.build_tools import msvc_exists, gcc_exists
-from weave.catalog import unique_file
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import inline_tools,ext_tools,c_spec
+from scipy.weave.build_tools import msvc_exists, gcc_exists
+from scipy.weave.catalog import unique_file
 
 
 def unique_mod(d,file_name):
@@ -66,21 +64,26 @@
 #         compilers.append(c)
     
 
-class IntConverter(NumpyTestCase):
+class IntConverter(TestCase):
     compiler = ''
-    def check_type_match_string(self,level=5):
+    @dec.slow
+    def test_type_match_string(self):
         s = c_spec.int_converter()
         assert( not s.type_match('string') )
-    def check_type_match_int(self,level=5):
+    @dec.slow
+    def test_type_match_int(self):
         s = c_spec.int_converter()
         assert(s.type_match(5))
-    def check_type_match_float(self,level=5):
+    @dec.slow
+    def test_type_match_float(self):
         s = c_spec.int_converter()
         assert(not s.type_match(5.))
-    def check_type_match_complex(self,level=5):
+    @dec.slow
+    def test_type_match_complex(self):
         s = c_spec.int_converter()
         assert(not s.type_match(5.+1j))
-    def check_var_in(self,level=5):
+    @dec.slow
+    def test_var_in(self):
         mod_name = 'int_var_in' + self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -103,7 +106,8 @@
         except TypeError:
             pass
 
-    def check_int_return(self,level=5):
+    @dec.slow
+    def test_int_return(self):
         mod_name = sys._getframe().f_code.co_name + self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -121,21 +125,26 @@
 
         assert( c == 3)
 
-class FloatConverter(NumpyTestCase):
+class FloatConverter(TestCase):
     compiler = ''
-    def check_type_match_string(self,level=5):
+    @dec.slow
+    def test_type_match_string(self):
         s = c_spec.float_converter()
         assert( not s.type_match('string'))
-    def check_type_match_int(self,level=5):
+    @dec.slow
+    def test_type_match_int(self):
         s = c_spec.float_converter()
         assert(not s.type_match(5))
-    def check_type_match_float(self,level=5):
+    @dec.slow
+    def test_type_match_float(self):
         s = c_spec.float_converter()
         assert(s.type_match(5.))
-    def check_type_match_complex(self,level=5):
+    @dec.slow
+    def test_type_match_complex(self):
         s = c_spec.float_converter()
         assert(not s.type_match(5.+1j))
-    def check_float_var_in(self,level=5):
+    @dec.slow
+    def test_float_var_in(self):
         mod_name = sys._getframe().f_code.co_name + self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -159,7 +168,8 @@
             pass
 
 
-    def check_float_return(self,level=5):
+    @dec.slow
+    def test_float_return(self):
         mod_name = sys._getframe().f_code.co_name + self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -176,21 +186,26 @@
         c = test(b)
         assert( c == 3.)
 
-class ComplexConverter(NumpyTestCase):
+class ComplexConverter(TestCase):
     compiler = ''
-    def check_type_match_string(self,level=5):
+    @dec.slow
+    def test_type_match_string(self):
         s = c_spec.complex_converter()
         assert( not s.type_match('string') )
-    def check_type_match_int(self,level=5):
+    @dec.slow
+    def test_type_match_int(self):
         s = c_spec.complex_converter()
         assert(not s.type_match(5))
-    def check_type_match_float(self,level=5):
+    @dec.slow
+    def test_type_match_float(self):
         s = c_spec.complex_converter()
         assert(not s.type_match(5.))
-    def check_type_match_complex(self,level=5):
+    @dec.slow
+    def test_type_match_complex(self):
         s = c_spec.complex_converter()
         assert(s.type_match(5.+1j))
-    def check_complex_var_in(self,level=5):
+    @dec.slow
+    def test_complex_var_in(self):
         mod_name = sys._getframe().f_code.co_name + self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -213,7 +228,8 @@
         except TypeError:
             pass
 
-    def check_complex_return(self,level=5):
+    @dec.slow
+    def test_complex_return(self):
         mod_name = sys._getframe().f_code.co_name + self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -234,9 +250,10 @@
 # File conversion tests
 #----------------------------------------------------------------------------
 
-class FileConverter(NumpyTestCase):
+class FileConverter(TestCase):
     compiler = ''
-    def check_py_to_file(self,level=5):
+    @dec.slow
+    def test_py_to_file(self):
         import tempfile
         file_name = tempfile.mktemp()
         file = open(file_name,'w')
@@ -247,7 +264,8 @@
         file.close()
         file = open(file_name,'r')
         assert(file.read() == "hello bob")
-    def check_file_to_py(self,level=5):
+    @dec.slow
+    def test_file_to_py(self):
         import tempfile
         file_name = tempfile.mktemp()
         # not sure I like Py::String as default -- might move to std::sting
@@ -268,16 +286,17 @@
 # Instance conversion tests
 #----------------------------------------------------------------------------
 
-class InstanceConverter(NumpyTestCase):
+class InstanceConverter(TestCase):
     pass
 
 #----------------------------------------------------------------------------
 # Callable object conversion tests
 #----------------------------------------------------------------------------
 
-class CallableConverter(NumpyTestCase):
+class CallableConverter(TestCase):
     compiler=''
-    def check_call_function(self,level=5):
+    @dec.slow
+    def test_call_function(self):
         import string
         func = string.find
         search_str = "hello world hello"
@@ -295,36 +314,45 @@
         desired = func(search_str,sub_str)
         assert(desired == actual)
 
-class SequenceConverter(NumpyTestCase):
+class SequenceConverter(TestCase):
     compiler = ''
-    def check_convert_to_dict(self,level=5):
+    @dec.slow
+    def test_convert_to_dict(self):
         d = {}
         inline_tools.inline("",['d'],compiler=self.compiler,force=1)
-    def check_convert_to_list(self,level=5):
+    @dec.slow
+    def test_convert_to_list(self):
         l = []
         inline_tools.inline("",['l'],compiler=self.compiler,force=1)
-    def check_convert_to_string(self,level=5):
+    @dec.slow
+    def test_convert_to_string(self):
         s = 'hello'
         inline_tools.inline("",['s'],compiler=self.compiler,force=1)
-    def check_convert_to_tuple(self,level=5):
+    @dec.slow
+    def test_convert_to_tuple(self):
         t = ()
         inline_tools.inline("",['t'],compiler=self.compiler,force=1)
 
-class StringConverter(NumpyTestCase):
+class StringConverter(TestCase):
     compiler = ''
-    def check_type_match_string(self,level=5):
+    @dec.slow
+    def test_type_match_string(self):
         s = c_spec.string_converter()
         assert( s.type_match('string') )
-    def check_type_match_int(self,level=5):
+    @dec.slow
+    def test_type_match_int(self):
         s = c_spec.string_converter()
         assert(not s.type_match(5))
-    def check_type_match_float(self,level=5):
+    @dec.slow
+    def test_type_match_float(self):
         s = c_spec.string_converter()
         assert(not s.type_match(5.))
-    def check_type_match_complex(self,level=5):
+    @dec.slow
+    def test_type_match_complex(self):
         s = c_spec.string_converter()
         assert(not s.type_match(5.+1j))
-    def check_var_in(self,level=5):
+    @dec.slow
+    def test_var_in(self):
         mod_name = 'string_var_in'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -348,7 +376,8 @@
         except TypeError:
             pass
 
-    def check_return(self,level=5):
+    @dec.slow
+    def test_return(self):
         mod_name = 'string_return'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -365,17 +394,20 @@
         c = test(b)
         assert( c == 'hello')
 
-class ListConverter(NumpyTestCase):
+class ListConverter(TestCase):
     compiler = ''
-    def check_type_match_bad(self,level=5):
+    @dec.slow
+    def test_type_match_bad(self):
         s = c_spec.list_converter()
         objs = [{},(),'',1,1.,1+1j]
         for i in objs:
             assert( not s.type_match(i) )
-    def check_type_match_good(self,level=5):
+    @dec.slow
+    def test_type_match_good(self):
         s = c_spec.list_converter()
         assert(s.type_match([]))
-    def check_var_in(self,level=5):
+    @dec.slow
+    def test_var_in(self):
         mod_name = 'list_var_in'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -398,7 +430,8 @@
         except TypeError:
             pass
 
-    def check_return(self,level=5):
+    @dec.slow
+    def test_return(self):
         mod_name = 'list_return'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -416,7 +449,8 @@
         c = test(b)
         assert( c == ['hello'])
 
-    def check_speed(self,level=5):
+    @dec.slow
+    def test_speed(self):
         mod_name = 'list_speed'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -476,17 +510,20 @@
         print 'python:', t2 - t1
         assert( sum1 == sum2 and sum1 == sum3)
 
-class TupleConverter(NumpyTestCase):
+class TupleConverter(TestCase):
     compiler = ''
-    def check_type_match_bad(self,level=5):
+    @dec.slow
+    def test_type_match_bad(self):
         s = c_spec.tuple_converter()
         objs = [{},[],'',1,1.,1+1j]
         for i in objs:
             assert( not s.type_match(i) )
-    def check_type_match_good(self,level=5):
+    @dec.slow
+    def test_type_match_good(self):
         s = c_spec.tuple_converter()
         assert(s.type_match((1,)))
-    def check_var_in(self,level=5):
+    @dec.slow
+    def test_var_in(self):
         mod_name = 'tuple_var_in'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -509,7 +546,8 @@
         except TypeError:
             pass
 
-    def check_return(self,level=5):
+    @dec.slow
+    def test_return(self):
         mod_name = 'tuple_return'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -529,7 +567,7 @@
         assert( c == ('hello',None))
 
 
-class DictConverter(NumpyTestCase):
+class DictConverter(TestCase):
     """ Base Class for dictionary conversion tests.
     """
 
@@ -539,15 +577,18 @@
     # so that it can run on its own.
     compiler=''
 
-    def check_type_match_bad(self,level=5):
+    @dec.slow
+    def test_type_match_bad(self):
         s = c_spec.dict_converter()
         objs = [[],(),'',1,1.,1+1j]
         for i in objs:
             assert( not s.type_match(i) )
-    def check_type_match_good(self,level=5):
+    @dec.slow
+    def test_type_match_good(self):
         s = c_spec.dict_converter()
         assert(s.type_match({}))
-    def check_var_in(self,level=5):
+    @dec.slow
+    def test_var_in(self):
         mod_name = 'dict_var_in'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -570,7 +611,8 @@
         except TypeError:
             pass
 
-    def check_return(self,level=5):
+    @dec.slow
+    def test_return(self):
         mod_name = 'dict_return'+self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -682,7 +724,7 @@
 # class TestGccInstanceConverter(TestInstanceConverter):
 #     compiler = 'gcc'
 
-def setup_test_location():
+def setup_location():
     import tempfile
     #test_dir = os.path.join(tempfile.gettempdir(),'test_files')
     test_dir = tempfile.mktemp()
@@ -691,9 +733,9 @@
     sys.path.insert(0,test_dir)
     return test_dir
 
-test_dir = setup_test_location()
+test_dir = setup_location()
 
-def teardown_test_location():
+def teardown_location():
     import tempfile
     test_dir = os.path.join(tempfile.gettempdir(),'test_files')
     if sys.path[0] == test_dir:
@@ -715,4 +757,4 @@
 #         if _n[:7]=='TestGcc': exec 'del '+_n
 # 
 if __name__ == "__main__":
-    NumpyTest('weave.c_spec').run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_catalog.py
===================================================================
--- trunk/scipy/weave/tests/test_catalog.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_catalog.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -2,18 +2,17 @@
 import os
 
 
-from numpy.testing import *
-set_package_path()
-from weave import catalog
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import catalog
+
 set_local_path()
 from weave_test_utils import *
 restore_path()
 
 
-class TestDefaultDir(NumpyTestCase):
-    def check_is_writable(self):
+class TestDefaultDir(TestCase):
+    def test_is_writable(self):
         path = catalog.default_dir()
         name = os.path.join(path,'dummy_catalog')
         test_file = open(name,'w')
@@ -23,49 +22,49 @@
             test_file.close()
             os.remove(name)
 
-class TestOsDependentCatalogName(NumpyTestCase):
+class TestOsDependentCatalogName(TestCase):
     pass
 
-class TestCatalogPath(NumpyTestCase):
-    def check_default(self):
+class TestCatalogPath(TestCase):
+    def test_default(self):
         in_path = catalog.default_dir()
         path = catalog.catalog_path(in_path)
         d,f = os.path.split(path)
         assert(d == in_path)
         assert(f == catalog.os_dependent_catalog_name())
-    def check_current(self):
+    def test_current(self):
         in_path = '.'
         path = catalog.catalog_path(in_path)
         d,f = os.path.split(path)
         assert(d == os.path.abspath(in_path))
         assert(f == catalog.os_dependent_catalog_name())
-    def check_user(path):
+    def test_user(path):
         if sys.platform != 'win32':
             in_path = '~'
             path = catalog.catalog_path(in_path)
             d,f = os.path.split(path)
             assert(d == os.path.expanduser(in_path))
             assert(f == catalog.os_dependent_catalog_name())
-    def check_module(self):
+    def test_module(self):
         # hand it a module and see if it uses the parent directory
         # of the module.
         path = catalog.catalog_path(os.__file__)
         d,f = os.path.split(os.__file__)
         d2,f = os.path.split(path)
         assert (d2 == d)
-    def check_path(self):
+    def test_path(self):
         # use os.__file__ to get a usable directory.
         in_path,f = os.path.split(os.__file__)
         path = catalog.catalog_path(in_path)
         d,f = os.path.split(path)
         assert (d == in_path)
-    def check_bad_path(self):
+    def test_bad_path(self):
         # stupid_path_name
         in_path = 'stupid_path_name'
         path = catalog.catalog_path(in_path)
         assert (path is None)
 
-class TestGetCatalog(NumpyTestCase):
+class TestGetCatalog(TestCase):
     """ This only tests whether new catalogs are created correctly.
         And whether non-existent return None correctly with read mode.
         Putting catalogs in the right place is all tested with
@@ -88,18 +87,18 @@
         import distutils.dir_util
         distutils.dir_util.remove_tree(d)
 
-    def check_nonexistent_catalog_is_none(self):
+    def test_nonexistent_catalog_is_none(self):
         pardir = self.get_test_dir(erase=1)
         cat = catalog.get_catalog(pardir,'r')
         self.remove_dir(pardir)
         assert(cat is None)
-    def check_create_catalog(self):
+    def test_create_catalog(self):
         pardir = self.get_test_dir(erase=1)
         cat = catalog.get_catalog(pardir,'c')
         self.remove_dir(pardir)
         assert(cat is not None)
 
-class TestCatalog(NumpyTestCase):
+class TestCatalog(TestCase):
 
     def clear_environ(self):
         if 'PYTHONCOMPILED' in os.environ:
@@ -116,46 +115,46 @@
     def tearDown(self):
         self.reset_environ()
 
-    def check_set_module_directory(self):
+    def test_set_module_directory(self):
         q = catalog.catalog()
         q.set_module_directory('bob')
         r = q.get_module_directory()
         assert (r == 'bob')
-    def check_clear_module_directory(self):
+    def test_clear_module_directory(self):
         q = catalog.catalog()
         r = q.get_module_directory()
         assert (r is None)
         q.set_module_directory('bob')
         r = q.clear_module_directory()
         assert (r is None)
-    def check_get_environ_path(self):
+    def test_get_environ_path(self):
         if sys.platform == 'win32': sep = ';'
         else: sep = ':'
         os.environ['PYTHONCOMPILED'] = sep.join(('path1','path2','path3'))
         q = catalog.catalog()
         path = q.get_environ_path()
         assert(path == ['path1','path2','path3'])
-    def check_build_search_order1(self):
+    def test_build_search_order1(self):
         """ MODULE in search path should be replaced by module_dir.
         """
         q = catalog.catalog(['first','MODULE','third'])
         q.set_module_directory('second')
         order = q.build_search_order()
         assert(order == ['first','second','third',catalog.default_dir()])
-    def check_build_search_order2(self):
+    def test_build_search_order2(self):
         """ MODULE in search path should be removed if module_dir==None.
         """
         q = catalog.catalog(['first','MODULE','third'])
         order = q.build_search_order()
         assert(order == ['first','third',catalog.default_dir()])
-    def check_build_search_order3(self):
+    def test_build_search_order3(self):
         """ If MODULE is absent, module_dir shouldn't be in search path.
         """
         q = catalog.catalog(['first','second'])
         q.set_module_directory('third')
         order = q.build_search_order()
         assert(order == ['first','second',catalog.default_dir()])
-    def check_build_search_order4(self):
+    def test_build_search_order4(self):
         """ Make sure environment variable is getting used.
         """
         q = catalog.catalog(['first','second'])
@@ -166,14 +165,14 @@
         order = q.build_search_order()
         assert(order == ['first','second','third','fourth','fifth',catalog.default_dir()])
 
-    def check_catalog_files1(self):
+    def test_catalog_files1(self):
         """ Be sure we get at least one file even without specifying the path.
         """
         q = catalog.catalog()
         files = q.get_catalog_files()
         assert(len(files) == 1)
 
-    def check_catalog_files2(self):
+    def test_catalog_files2(self):
         """ Ignore bad paths in the path.
         """
         q = catalog.catalog()
@@ -181,7 +180,7 @@
         files = q.get_catalog_files()
         assert(len(files) == 1)
 
-    def check_get_existing_files1(self):
+    def test_get_existing_files1(self):
         """ Shouldn't get any files when temp doesn't exist and no path set.
         """
         clear_temp_catalog()
@@ -189,7 +188,7 @@
         files = q.get_existing_files()
         restore_temp_catalog()
         assert(len(files) == 0)
-    def check_get_existing_files2(self):
+    def test_get_existing_files2(self):
         """ Shouldn't get a single file from the temp dir.
         """
         clear_temp_catalog()
@@ -203,7 +202,7 @@
         restore_temp_catalog()
         assert(len(files) == 1)
 
-    def check_access_writable_file(self):
+    def test_access_writable_file(self):
         """ There should always be a writable file -- even if it is in temp
         """
         q = catalog.catalog()
@@ -214,7 +213,7 @@
         finally:
             f.close()
             os.remove(file)
-    def check_writable_with_bad_path(self):
+    def test_writable_with_bad_path(self):
         """ There should always be a writable file -- even if search paths contain
             bad values.
         """
@@ -229,7 +228,7 @@
         finally:
             f.close()
         os.remove(file)
-    def check_writable_dir(self):
+    def test_writable_dir(self):
         """ Check that we can create a file in the writable directory
         """
         q = catalog.catalog()
@@ -241,7 +240,7 @@
         finally:
             f.close()
             os.remove(file)
-    def check_unique_module_name(self):
+    def test_unique_module_name(self):
         """ Check that we can create a file in the writable directory
         """
         q = catalog.catalog()
@@ -259,7 +258,7 @@
         cfile2 = file+'.cpp'
         assert(not os.path.exists(cfile2+'.cpp'))
         os.remove(cfile1)
-    def check_add_function_persistent1(self):
+    def test_add_function_persistent1(self):
         """ Test persisting a function in the default catalog
         """
         clear_temp_catalog()
@@ -275,7 +274,7 @@
         for i in funcs:
             assert(i in pfuncs)
 
-    def check_add_function_ordered(self):
+    def test_add_function_ordered(self):
         clear_temp_catalog()
         q = catalog.catalog()
         import string
@@ -332,4 +331,4 @@
 
 
 if __name__ == '__main__':
-    NumpyTest('weave.catalog').run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_ext_tools.py
===================================================================
--- trunk/scipy/weave/tests/test_ext_tools.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_ext_tools.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,15 +1,15 @@
 
 import time
 
-from numpy.testing import *
-set_package_path()
-from weave import ext_tools, c_spec
+from scipy.testing import *
+
+from scipy.weave import ext_tools, c_spec
 try:
-    from weave.standard_array_spec import array_converter
+    from scipy.weave.standard_array_spec import array_converter
 except ImportError:
     pass # requires numpy.numerix
-restore_path()
 
+
 set_local_path()
 from weave_test_utils import *
 restore_path()
@@ -17,14 +17,16 @@
 build_dir = empty_temp_dir()
 print 'building extensions here:', build_dir
 
-class TestExtModule(NumpyTestCase):
+class TestExtModule(TestCase):
     #should really do some testing of where modules end up
-    def check_simple(self,level=5):
+    @dec.slow
+    def test_simple(self):
         """ Simplest possible module """
         mod = ext_tools.ext_module('simple_ext_module')
         mod.compile(location = build_dir)
         import simple_ext_module
-    def check_multi_functions(self,level=5):
+    @dec.slow
+    def test_multi_functions(self):
         mod = ext_tools.ext_module('module_multi_function')
         var_specs = []
         code = ""
@@ -36,7 +38,8 @@
         import module_multi_function
         module_multi_function.test()
         module_multi_function.test2()
-    def check_with_include(self,level=5):
+    @dec.slow
+    def test_with_include(self):
         # decalaring variables
         a = 2.;
 
@@ -57,7 +60,8 @@
         import ext_module_with_include
         ext_module_with_include.test(a)
 
-    def check_string_and_int(self,level=5):
+    @dec.slow
+    def test_string_and_int(self):
         # decalaring variables
         a = 2;b = 'string'
         # declare module
@@ -73,7 +77,8 @@
         c = ext_string_and_int.test(a,b)
         assert(c == len(b))
 
-    def check_return_tuple(self,level=5):
+    @dec.slow
+    def test_return_tuple(self):
         # decalaring variables
         a = 2
         # declare module
@@ -94,9 +99,10 @@
         c,d = ext_return_tuple.test(a)
         assert(c==a and d == a+1)
 
-class TestExtFunction(NumpyTestCase):
+class TestExtFunction(TestCase):
     #should really do some testing of where modules end up
-    def check_simple(self,level=5):
+    @dec.slow
+    def test_simple(self):
         """ Simplest possible function """
         mod = ext_tools.ext_module('simple_ext_function')
         var_specs = []
@@ -107,8 +113,8 @@
         import simple_ext_function
         simple_ext_function.test()
 
-class TestAssignVariableTypes(NumpyTestCase):
-    def check_assign_variable_types(self):
+class TestAssignVariableTypes(TestCase):
+    def test_assign_variable_types(self):
         try:
             from numpy.numerix import arange, Float32, Float64
         except:
@@ -135,4 +141,4 @@
         print_assert_equal(expr,actual,desired)
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_inline_tools.py
===================================================================
--- trunk/scipy/weave/tests/test_inline_tools.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_inline_tools.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,20 +1,21 @@
 
 from numpy import *
 
-from numpy.testing import *
-set_package_path()
-from weave import inline_tools
-restore_path()
+from scipy.testing import *
+
+from scipy.weave import inline_tools
+
 set_local_path()
 from test_scxx import *
 restore_path()
 
-class TestInline(NumpyTestCase):
+class TestInline(TestCase):
     """ These are long running tests...
 
          I'd like to benchmark these things somehow.
     """
-    def check_exceptions(self,level=5):
+    @dec.slow
+    def test_exceptions(self):
         a = 3
         code = """
                if (a < 2)
@@ -43,4 +44,4 @@
             pass
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_numpy_scalar_spec.py
===================================================================
--- trunk/scipy/weave/tests/test_numpy_scalar_spec.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_numpy_scalar_spec.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -10,16 +10,13 @@
 test_dir = ''
 
 import numpy
-from numpy.testing import *
-set_package_path()
-from weave import inline_tools,ext_tools
-from weave.build_tools import msvc_exists, gcc_exists
-from weave.catalog import unique_file
-from weave.numpy_scalar_spec import numpy_complex_scalar_converter
+from scipy.testing import *
 
-restore_path()
+from scipy.weave import inline_tools,ext_tools
+from scipy.weave.build_tools import msvc_exists, gcc_exists
+from scipy.weave.catalog import unique_file
+from scipy.weave.numpy_scalar_spec import numpy_complex_scalar_converter
 
-
 def unique_mod(d,file_name):
     f = os.path.basename(unique_file(d,file_name))
     m = os.path.splitext(f)[0]
@@ -52,22 +49,27 @@
 #   int, float, complex
 #----------------------------------------------------------------------------
 
-class NumpyComplexScalarConverter(NumpyTestCase):
+class NumpyComplexScalarConverter(TestCase):
     compiler = ''
 
     def setUp(self):
         self.converter = numpy_complex_scalar_converter()
 
-    def check_type_match_string(self,level=5):
+    @dec.slow
+    def test_type_match_string(self):
         assert( not self.converter.type_match('string') )
-    def check_type_match_int(self,level=5):
+    @dec.slow
+    def test_type_match_int(self):
         assert( not self.converter.type_match(5))
-    def check_type_match_float(self,level=5):
+    @dec.slow
+    def test_type_match_float(self):
         assert( not self.converter.type_match(5.))
-    def check_type_match_complex128(self,level=5):
+    @dec.slow
+    def test_type_match_complex128(self):
         assert(self.converter.type_match(numpy.complex128(5.+1j)))
 
-    def check_complex_var_in(self,level=5):
+    @dec.slow
+    def test_complex_var_in(self):
         mod_name = sys._getframe().f_code.co_name + self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -90,7 +92,8 @@
         except TypeError:
             pass
 
-    def check_complex_return(self,level=5):
+    @dec.slow
+    def test_complex_return(self):
         mod_name = sys._getframe().f_code.co_name + self.compiler
         mod_name = unique_mod(test_dir,mod_name)
         mod = ext_tools.ext_module(mod_name)
@@ -107,7 +110,8 @@
         c = test(b)
         assert( c == 3.+3j)
 
-    def check_inline(self, level=5):
+    @dec.slow
+    def test_inline(self):
         a = numpy.complex128(1+1j)
         result = inline_tools.inline("return_val=1.0/a;",['a'])
         assert( result==.5-.5j)
@@ -164,4 +168,4 @@
         if _n[:7]=='TestGcc': exec 'del '+_n
 
 if __name__ == "__main__":
-    NumpyTest('weave.numpy_scalar_spec').run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_scxx.py
===================================================================
--- trunk/scipy/weave/tests/test_scxx.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_scxx.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,12 +4,12 @@
 import time
 import os,sys
 
-from numpy.testing import *
+from scipy.testing import *
 set_local_path()
 from test_scxx_object import *
 from test_scxx_sequence import *
 from test_scxx_dict import *
-restore_path()
 
+
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_scxx_dict.py
===================================================================
--- trunk/scipy/weave/tests/test_scxx_dict.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_scxx_dict.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,18 +4,19 @@
 import os
 import sys
 
-from numpy.testing import *
-set_package_path()
-from weave import inline_tools
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import inline_tools
 
-class TestDictConstruct(NumpyTestCase):
+
+
+class TestDictConstruct(TestCase):
     #------------------------------------------------------------------------
     # Check that construction from basic types is allowed and have correct
     # reference counts
     #------------------------------------------------------------------------
-    def check_empty(self,level=5):
+    @dec.slow
+    def test_empty(self):
         # strange int value used to try and make sure refcount is 2.
         code = """
                py::dict val;
@@ -26,8 +27,9 @@
         assert res == {}
 
 
-class TestDictHasKey(NumpyTestCase):
-    def check_obj(self,level=5):
+class TestDictHasKey(TestCase):
+    @dec.slow
+    def test_obj(self):
         class Foo:
             pass
         key = Foo()
@@ -38,7 +40,8 @@
                """
         res = inline_tools.inline(code,['a','key'])
         assert res
-    def check_int(self,level=5):
+    @dec.slow
+    def test_int(self):
         a = {}
         a[1234] = 12345
         code = """
@@ -46,7 +49,8 @@
                """
         res = inline_tools.inline(code,['a'])
         assert res
-    def check_double(self,level=5):
+    @dec.slow
+    def test_double(self):
         a = {}
         a[1234.] = 12345
         code = """
@@ -54,7 +58,8 @@
                """
         res = inline_tools.inline(code,['a'])
         assert res
-    def check_complex(self,level=5):
+    @dec.slow
+    def test_complex(self):
         a = {}
         a[1+1j] = 12345
         key = 1+1j
@@ -64,7 +69,8 @@
         res = inline_tools.inline(code,['a','key'])
         assert res
 
-    def check_string(self,level=5):
+    @dec.slow
+    def test_string(self):
         a = {}
         a["b"] = 12345
         code = """
@@ -72,7 +78,8 @@
                """
         res = inline_tools.inline(code,['a'])
         assert res
-    def check_std_string(self,level=5):
+    @dec.slow
+    def test_std_string(self):
         a = {}
         a["b"] = 12345
         key_name = "b"
@@ -81,7 +88,8 @@
                """
         res = inline_tools.inline(code,['a','key_name'])
         assert res
-    def check_string_fail(self,level=5):
+    @dec.slow
+    def test_string_fail(self):
         a = {}
         a["b"] = 12345
         code = """
@@ -90,7 +98,7 @@
         res = inline_tools.inline(code,['a'])
         assert not res
 
-class TestDictGetItemOp(NumpyTestCase):
+class TestDictGetItemOp(TestCase):
 
     def generic_get(self,code,args=['a']):
         a = {}
@@ -99,10 +107,13 @@
         res = inline_tools.inline(code,args)
         assert res == a['b']
 
-    def check_char(self,level=5):
+    @dec.slow
+    def test_char(self):
         self.generic_get('return_val = a["b"];')
 
-    def DOESNT_WORK_check_char_fail(self,level=5):
+    @dec.slow
+    @dec.willfail
+    def test_char_fail(self):
         # We can't through a KeyError for dicts on RHS of
         # = but not on LHS.  Not sure how to deal with this.
         try:
@@ -110,18 +121,22 @@
         except KeyError:
             pass
 
-    def check_string(self,level=5):
+    @dec.slow
+    def test_string(self):
         self.generic_get('return_val = a[std::string("b")];')
 
 
-    def check_obj(self,level=5):
+    @dec.slow
+    def test_obj(self):
         code = """
                py::object name = "b";
                return_val = a[name];
                """
         self.generic_get(code,['a'])
 
-    def DOESNT_WORK_check_obj_fail(self,level=5):
+    @dec.slow
+    @dec.willfail
+    def test_obj_fail(self):
         # We can't through a KeyError for dicts on RHS of
         # = but not on LHS.  Not sure how to deal with this.
         try:
@@ -133,7 +148,7 @@
         except KeyError:
             pass
 
-class TestDictSetOperator(NumpyTestCase):
+class TestDictSetOperator(TestCase):
     def generic_new(self,key,val):
         # test that value is set correctly and that reference counts
         # on dict, key, and val are being handled correctly.
@@ -164,43 +179,53 @@
         assert before == after
         assert before_overwritten == after_overwritten
 
-    def check_new_int_int(self,level=5):
+    @dec.slow
+    def test_new_int_int(self):
         key,val = 1234,12345
         self.generic_new(key,val)
-    def check_new_double_int(self,level=5):
+    @dec.slow
+    def test_new_double_int(self):
         key,val = 1234.,12345
         self.generic_new(key,val)
-    def check_new_std_string_int(self,level=5):
+    @dec.slow
+    def test_new_std_string_int(self):
         key,val = "hello",12345
         self.generic_new(key,val)
-    def check_new_complex_int(self,level=5):
+    @dec.slow
+    def test_new_complex_int(self):
         key,val = 1+1j,12345
         self.generic_new(key,val)
-    def check_new_obj_int(self,level=5):
+    @dec.slow
+    def test_new_obj_int(self):
         class Foo:
             pass
         key,val = Foo(),12345
         self.generic_new(key,val)
 
-    def check_overwrite_int_int(self,level=5):
+    @dec.slow
+    def test_overwrite_int_int(self):
         key,val = 1234,12345
         self.generic_overwrite(key,val)
-    def check_overwrite_double_int(self,level=5):
+    @dec.slow
+    def test_overwrite_double_int(self):
         key,val = 1234.,12345
         self.generic_overwrite(key,val)
-    def check_overwrite_std_string_int(self,level=5):
+    @dec.slow
+    def test_overwrite_std_string_int(self):
         key,val = "hello",12345
         self.generic_overwrite(key,val)
-    def check_overwrite_complex_int(self,level=5):
+    @dec.slow
+    def test_overwrite_complex_int(self):
         key,val = 1+1j,12345
         self.generic_overwrite(key,val)
-    def check_overwrite_obj_int(self,level=5):
+    @dec.slow
+    def test_overwrite_obj_int(self):
         class Foo:
             pass
         key,val = Foo(),12345
         self.generic_overwrite(key,val)
 
-class TestDictDel(NumpyTestCase):
+class TestDictDel(TestCase):
     def generic(self,key):
         # test that value is set correctly and that reference counts
         # on dict, key, are being handled correctly. after deletion,
@@ -216,46 +241,56 @@
         after = sys.getrefcount(a), sys.getrefcount(key)
         assert before[0] == after[0]
         assert before[1] == after[1] + 1
-    def check_int(self,level=5):
+    @dec.slow
+    def test_int(self):
         key = 1234
         self.generic(key)
-    def check_double(self,level=5):
+    @dec.slow
+    def test_double(self):
         key = 1234.
         self.generic(key)
-    def check_std_string(self,level=5):
+    @dec.slow
+    def test_std_string(self):
         key = "hello"
         self.generic(key)
-    def check_complex(self,level=5):
+    @dec.slow
+    def test_complex(self):
         key = 1+1j
         self.generic(key)
-    def check_obj(self,level=5):
+    @dec.slow
+    def test_obj(self):
         class Foo:
             pass
         key = Foo()
         self.generic(key)
 
-class TestDictOthers(NumpyTestCase):
-    def check_clear(self,level=5):
+class TestDictOthers(TestCase):
+    @dec.slow
+    def test_clear(self):
         a = {}
         a["hello"] = 1
         inline_tools.inline("a.clear();",['a'])
         assert not a
-    def check_items(self,level=5):
+    @dec.slow
+    def test_items(self):
         a = {}
         a["hello"] = 1
         items = inline_tools.inline("return_val = a.items();",['a'])
         assert items == a.items()
-    def check_values(self,level=5):
+    @dec.slow
+    def test_values(self):
         a = {}
         a["hello"] = 1
         values = inline_tools.inline("return_val = a.values();",['a'])
         assert values == a.values()
-    def check_keys(self,level=5):
+    @dec.slow
+    def test_keys(self):
         a = {}
         a["hello"] = 1
         keys = inline_tools.inline("return_val = a.keys();",['a'])
         assert keys == a.keys()
-    def check_update(self,level=5):
+    @dec.slow
+    def test_update(self):
         a,b = {},{}
         a["hello"] = 1
         b["hello"] = 2
@@ -263,4 +298,4 @@
         assert a == b
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_scxx_object.py
===================================================================
--- trunk/scipy/weave/tests/test_scxx_object.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_scxx_object.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,17 +4,18 @@
 import os
 import sys
 
-from numpy.testing import *
-set_package_path()
-from weave import inline_tools
-restore_path()
+from scipy.testing import *
 
-class TestObjectConstruct(NumpyTestCase):
+from scipy.weave import inline_tools
+
+
+class TestObjectConstruct(TestCase):
     #------------------------------------------------------------------------
     # Check that construction from basic types is allowed and have correct
     # reference counts
     #------------------------------------------------------------------------
-    def check_int(self,level=5):
+    @dec.slow
+    def test_int(self):
         # strange int value used to try and make sure refcount is 2.
         code = """
                py::object val = 1001;
@@ -23,7 +24,8 @@
         res = inline_tools.inline(code)
         assert_equal(sys.getrefcount(res),2)
         assert_equal(res,1001)
-    def check_float(self,level=5):
+    @dec.slow
+    def test_float(self):
         code = """
                py::object val = (float)1.0;
                return_val = val;
@@ -31,7 +33,8 @@
         res = inline_tools.inline(code)
         assert_equal(sys.getrefcount(res),2)
         assert_equal(res,1.0)
-    def check_double(self,level=5):
+    @dec.slow
+    def test_double(self):
         code = """
                py::object val = 1.0;
                return_val = val;
@@ -39,7 +42,8 @@
         res = inline_tools.inline(code)
         assert_equal(sys.getrefcount(res),2)
         assert_equal(res,1.0)
-    def check_complex(self,level=5):
+    @dec.slow
+    def test_complex(self):
         code = """
                std::complex<double> num = std::complex<double>(1.0,1.0);
                py::object val = num;
@@ -48,7 +52,8 @@
         res = inline_tools.inline(code)
         assert_equal(sys.getrefcount(res),2)
         assert_equal(res,1.0+1.0j)
-    def check_string(self,level=5):
+    @dec.slow
+    def test_string(self):
         code = """
                py::object val = "hello";
                return_val = val;
@@ -57,7 +62,8 @@
         assert_equal(sys.getrefcount(res),2)
         assert_equal(res,"hello")
 
-    def check_std_string(self,level=5):
+    @dec.slow
+    def test_std_string(self):
         code = """
                std::string s = std::string("hello");
                py::object val = s;
@@ -67,18 +73,20 @@
         assert_equal(sys.getrefcount(res),2)
         assert_equal(res,"hello")
 
-class TestObjectPrint(NumpyTestCase):
+class TestObjectPrint(TestCase):
     #------------------------------------------------------------------------
     # Check the object print protocol.
     #------------------------------------------------------------------------
-    def check_stdout(self,level=5):
+    @dec.slow
+    def test_stdout(self):
         code = """
                py::object val = "how now brown cow";
                val.print(stdout);
                """
         res = inline_tools.inline(code)
         # visual check on this one.
-    def check_stringio(self,level=5):
+    @dec.slow
+    def test_stringio(self):
         import cStringIO
         file_imposter = cStringIO.StringIO()
         code = """
@@ -89,7 +97,8 @@
         print file_imposter.getvalue()
         assert_equal(file_imposter.getvalue(),"'how now brown cow'")
 
-##    def check_failure(self,level=5):
+##    @dec.slow
+##    def test_failure(self):
 ##        code = """
 ##               FILE* file = 0;
 ##               py::object val = "how now brown cow";
@@ -102,33 +111,38 @@
 ##            pass
 
 
-class TestObjectCast(NumpyTestCase):
-    def check_int_cast(self,level=5):
+class TestObjectCast(TestCase):
+    @dec.slow
+    def test_int_cast(self):
         code = """
                py::object val = 1;
                int raw_val = val;
                """
         inline_tools.inline(code)
-    def check_double_cast(self,level=5):
+    @dec.slow
+    def test_double_cast(self):
         code = """
                py::object val = 1.0;
                double raw_val = val;
                """
         inline_tools.inline(code)
-    def check_float_cast(self,level=5):
+    @dec.slow
+    def test_float_cast(self):
         code = """
                py::object val = 1.0;
                float raw_val = val;
                """
         inline_tools.inline(code)
-    def check_complex_cast(self,level=5):
+    @dec.slow
+    def test_complex_cast(self):
         code = """
                std::complex<double> num = std::complex<double>(1.0,1.0);
                py::object val = num;
                std::complex<double> raw_val = val;
                """
         inline_tools.inline(code)
-    def check_string_cast(self,level=5):
+    @dec.slow
+    def test_string_cast(self):
         code = """
                py::object val = "hello";
                std::string raw_val = val;
@@ -148,8 +162,9 @@
 #    def __str__(self):
 #        return "b"
 
-class TestObjectHasattr(NumpyTestCase):
-    def check_string(self,level=5):
+class TestObjectHasattr(TestCase):
+    @dec.slow
+    def test_string(self):
         a = Foo()
         a.b = 12345
         code = """
@@ -157,7 +172,8 @@
                """
         res = inline_tools.inline(code,['a'])
         assert res
-    def check_std_string(self,level=5):
+    @dec.slow
+    def test_std_string(self):
         a = Foo()
         a.b = 12345
         attr_name = "b"
@@ -166,7 +182,8 @@
                """
         res = inline_tools.inline(code,['a','attr_name'])
         assert res
-    def check_string_fail(self,level=5):
+    @dec.slow
+    def test_string_fail(self):
         a = Foo()
         a.b = 12345
         code = """
@@ -174,7 +191,8 @@
                """
         res = inline_tools.inline(code,['a'])
         assert not res
-    def check_inline(self,level=5):
+    @dec.slow
+    def test_inline(self):
         """ THIS NEEDS TO MOVE TO THE INLINE TEST SUITE
         """
         a = Foo()
@@ -195,7 +213,8 @@
             print 'before, after, after2:', before, after, after2
             pass
 
-    def check_func(self,level=5):
+    @dec.slow
+    def test_func(self):
         a = Foo()
         a.b = 12345
         code = """
@@ -204,7 +223,7 @@
         res = inline_tools.inline(code,['a'])
         assert res
 
-class TestObjectAttr(NumpyTestCase):
+class TestObjectAttr(TestCase):
 
     def generic_attr(self,code,args=['a']):
         a = Foo()
@@ -217,32 +236,38 @@
         after = sys.getrefcount(a.b)
         assert_equal(after,before)
 
-    def check_char(self,level=5):
+    @dec.slow
+    def test_char(self):
         self.generic_attr('return_val = a.attr("b");')
 
-    def check_char_fail(self,level=5):
+    @dec.slow
+    def test_char_fail(self):
         try:
             self.generic_attr('return_val = a.attr("c");')
         except AttributeError:
             pass
 
-    def check_string(self,level=5):
+    @dec.slow
+    def test_string(self):
         self.generic_attr('return_val = a.attr(std::string("b"));')
 
-    def check_string_fail(self,level=5):
+    @dec.slow
+    def test_string_fail(self):
         try:
             self.generic_attr('return_val = a.attr(std::string("c"));')
         except AttributeError:
             pass
 
-    def check_obj(self,level=5):
+    @dec.slow
+    def test_obj(self):
         code = """
                py::object name = "b";
                return_val = a.attr(name);
                """
         self.generic_attr(code,['a'])
 
-    def check_obj_fail(self,level=5):
+    @dec.slow
+    def test_obj_fail(self):
         try:
             code = """
                    py::object name = "c";
@@ -252,7 +277,8 @@
         except AttributeError:
             pass
 
-    def check_attr_call(self,level=5):
+    @dec.slow
+    def test_attr_call(self):
         a = Foo()
         res = inline_tools.inline('return_val = a.attr("bar").call();',['a'])
         first = sys.getrefcount(res)
@@ -262,7 +288,7 @@
         assert_equal(res,"bar results")
         assert_equal(first,second)
 
-class TestObjectSetAttr(NumpyTestCase):
+class TestObjectSetAttr(TestCase):
 
     def generic_existing(self, code, desired):
         args = ['a']
@@ -277,27 +303,34 @@
         res = inline_tools.inline(code,args)
         assert_equal(a.b,desired)
 
-    def check_existing_char(self,level=5):
+    @dec.slow
+    def test_existing_char(self):
         self.generic_existing('a.set_attr("b","hello");',"hello")
-    def check_new_char(self,level=5):
+    @dec.slow
+    def test_new_char(self):
         self.generic_new('a.set_attr("b","hello");',"hello")
-    def check_existing_string(self,level=5):
+    @dec.slow
+    def test_existing_string(self):
         self.generic_existing('a.set_attr("b",std::string("hello"));',"hello")
-    def check_new_string(self,level=5):
+    @dec.slow
+    def test_new_string(self):
         self.generic_new('a.set_attr("b",std::string("hello"));',"hello")
-    def check_existing_object(self,level=5):
+    @dec.slow
+    def test_existing_object(self):
         code = """
                py::object obj = "hello";
                a.set_attr("b",obj);
                """
         self.generic_existing(code,"hello")
-    def check_new_object(self,level=5):
+    @dec.slow
+    def test_new_object(self):
         code = """
                py::object obj = "hello";
                a.set_attr("b",obj);
                """
         self.generic_new(code,"hello")
-    def check_new_fail(self,level=5):
+    @dec.slow
+    def test_new_fail(self):
         try:
             code = """
                    py::object obj = 1;
@@ -307,26 +340,31 @@
         except:
             pass
 
-    def check_existing_int(self,level=5):
+    @dec.slow
+    def test_existing_int(self):
         self.generic_existing('a.set_attr("b",1);',1)
-    def check_existing_double(self,level=5):
+    @dec.slow
+    def test_existing_double(self):
         self.generic_existing('a.set_attr("b",1.0);',1.0)
-    def check_existing_complex(self,level=5):
+    @dec.slow
+    def test_existing_complex(self):
         code = """
                std::complex<double> obj = std::complex<double>(1,1);
                a.set_attr("b",obj);
                """
         self.generic_existing(code,1+1j)
-    def check_existing_char1(self,level=5):
+    @dec.slow
+    def test_existing_char1(self):
         self.generic_existing('a.set_attr("b","hello");',"hello")
-    def check_existing_string1(self,level=5):
+    @dec.slow
+    def test_existing_string1(self):
         code = """
                std::string obj = std::string("hello");
                a.set_attr("b",obj);
                """
         self.generic_existing(code,"hello")
 
-class TestObjectDel(NumpyTestCase):
+class TestObjectDel(TestCase):
     def generic(self, code):
         args = ['a']
         a = Foo()
@@ -334,27 +372,32 @@
         res = inline_tools.inline(code,args)
         assert not hasattr(a,"b")
 
-    def check_char(self,level=5):
+    @dec.slow
+    def test_char(self):
         self.generic('a.del("b");')
-    def check_string(self,level=5):
+    @dec.slow
+    def test_string(self):
         code = """
                std::string name = std::string("b");
                a.del(name);
                """
         self.generic(code)
-    def check_object(self,level=5):
+    @dec.slow
+    def test_object(self):
         code = """
                py::object name = py::object("b");
                a.del(name);
                """
         self.generic(code)
 
-class TestObjectCmp(NumpyTestCase):
-    def check_equal(self,level=5):
+class TestObjectCmp(TestCase):
+    @dec.slow
+    def test_equal(self):
         a,b = 1,1
         res = inline_tools.inline('return_val = (a == b);',['a','b'])
         assert_equal(res,(a == b))
-    def check_equal_objects(self,level=5):
+    @dec.slow
+    def test_equal_objects(self):
         class Foo:
             def __init__(self,x):
                 self.x = x
@@ -363,47 +406,58 @@
         a,b = Foo(1),Foo(2)
         res = inline_tools.inline('return_val = (a == b);',['a','b'])
         assert_equal(res,(a == b))
-    def check_lt(self,level=5):
+    @dec.slow
+    def test_lt(self):
         a,b = 1,2
         res = inline_tools.inline('return_val = (a < b);',['a','b'])
         assert_equal(res,(a < b))
-    def check_gt(self,level=5):
+    @dec.slow
+    def test_gt(self):
         a,b = 1,2
         res = inline_tools.inline('return_val = (a > b);',['a','b'])
         assert_equal(res,(a > b))
-    def check_gte(self,level=5):
+    @dec.slow
+    def test_gte(self):
         a,b = 1,2
         res = inline_tools.inline('return_val = (a >= b);',['a','b'])
         assert_equal(res,(a >= b))
-    def check_lte(self,level=5):
+    @dec.slow
+    def test_lte(self):
         a,b = 1,2
         res = inline_tools.inline('return_val = (a <= b);',['a','b'])
         assert_equal(res,(a <= b))
-    def check_not_equal(self,level=5):
+    @dec.slow
+    def test_not_equal(self):
         a,b = 1,2
         res = inline_tools.inline('return_val = (a != b);',['a','b'])
         assert_equal(res,(a != b))
-    def check_int(self,level=5):
+    @dec.slow
+    def test_int(self):
         a = 1
         res = inline_tools.inline('return_val = (a == 1);',['a'])
         assert_equal(res,(a == 1))
-    def check_int2(self,level=5):
+    @dec.slow
+    def test_int2(self):
         a = 1
         res = inline_tools.inline('return_val = (1 == a);',['a'])
         assert_equal(res,(a == 1))
-    def check_unsigned_long(self,level=5):
+    @dec.slow
+    def test_unsigned_long(self):
         a = 1
         res = inline_tools.inline('return_val = (a == (unsigned long)1);',['a'])
         assert_equal(res,(a == 1))
-    def check_double(self,level=5):
+    @dec.slow
+    def test_double(self):
         a = 1
         res = inline_tools.inline('return_val = (a == 1.0);',['a'])
         assert_equal(res,(a == 1.0))
-    def check_char(self,level=5):
+    @dec.slow
+    def test_char(self):
         a = "hello"
         res = inline_tools.inline('return_val = (a == "hello");',['a'])
         assert_equal(res,(a == "hello"))
-    def check_std_string(self,level=5):
+    @dec.slow
+    def test_std_string(self):
         a = "hello"
         code = """
                std::string hello = std::string("hello");
@@ -412,8 +466,9 @@
         res = inline_tools.inline(code,['a'])
         assert_equal(res,(a == "hello"))
 
-class TestObjectRepr(NumpyTestCase):
-    def check_repr(self,level=5):
+class TestObjectRepr(TestCase):
+    @dec.slow
+    def test_repr(self):
         class Foo:
             def __str__(self):
                 return "str return"
@@ -428,8 +483,9 @@
         assert_equal(first,second)
         assert_equal(res,"repr return")
 
-class TestObjectStr(NumpyTestCase):
-    def check_str(self,level=5):
+class TestObjectStr(TestCase):
+    @dec.slow
+    def test_str(self):
         class Foo:
             def __str__(self):
                 return "str return"
@@ -445,9 +501,10 @@
         print res
         assert_equal(res,"str return")
 
-class TestObjectUnicode(NumpyTestCase):
+class TestObjectUnicode(TestCase):
     # This ain't going to win awards for test of the year...
-    def check_unicode(self,level=5):
+    @dec.slow
+    def test_unicode(self):
         class Foo:
             def __repr__(self):
                 return "repr return"
@@ -462,29 +519,33 @@
         assert_equal(first,second)
         assert_equal(res,"unicode")
 
-class TestObjectIsCallable(NumpyTestCase):
-    def check_true(self,level=5):
+class TestObjectIsCallable(TestCase):
+    @dec.slow
+    def test_true(self):
         class Foo:
             def __call__(self):
                 return 0
         a= Foo()
         res = inline_tools.inline('return_val = a.is_callable();',['a'])
         assert res
-    def check_false(self,level=5):
+    @dec.slow
+    def test_false(self):
         class Foo:
             pass
         a= Foo()
         res = inline_tools.inline('return_val = a.is_callable();',['a'])
         assert not res
 
-class TestObjectCall(NumpyTestCase):
-    def check_noargs(self,level=5):
+class TestObjectCall(TestCase):
+    @dec.slow
+    def test_noargs(self):
         def Foo():
             return (1,2,3)
         res = inline_tools.inline('return_val = Foo.call();',['Foo'])
         assert_equal(res,(1,2,3))
         assert_equal(sys.getrefcount(res),3) # should be 2?
-    def check_args(self,level=5):
+    @dec.slow
+    def test_args(self):
         def Foo(val1,val2):
             return (val1,val2)
         code = """
@@ -496,7 +557,8 @@
         res = inline_tools.inline(code,['Foo'])
         assert_equal(res,(1,"hello"))
         assert_equal(sys.getrefcount(res),2)
-    def check_args_kw(self,level=5):
+    @dec.slow
+    def test_args_kw(self):
         def Foo(val1,val2,val3=1):
             return (val1,val2,val3)
         code = """
@@ -510,7 +572,8 @@
         res = inline_tools.inline(code,['Foo'])
         assert_equal(res,(1,"hello",3))
         assert_equal(sys.getrefcount(res),2)
-    def check_noargs_with_args(self,level=5):
+    @dec.slow
+    def test_noargs_with_args(self):
         # calling a function that does take args with args
         # should fail.
         def Foo():
@@ -533,8 +596,9 @@
         # first should == second, but the weird refcount error
         assert_equal(second,third)
 
-class TestObjectMcall(NumpyTestCase):
-    def check_noargs(self,level=5):
+class TestObjectMcall(TestCase):
+    @dec.slow
+    def test_noargs(self):
         a = Foo()
         res = inline_tools.inline('return_val = a.mcall("bar");',['a'])
         assert_equal(res,"bar results")
@@ -544,7 +608,8 @@
         assert_equal(res,"bar results")
         second = sys.getrefcount(res)
         assert_equal(first,second)
-    def check_args(self,level=5):
+    @dec.slow
+    def test_args(self):
         a = Foo()
         code = """
                py::tuple args(2);
@@ -555,7 +620,8 @@
         res = inline_tools.inline(code,['a'])
         assert_equal(res,(1,"hello"))
         assert_equal(sys.getrefcount(res),2)
-    def check_args_kw(self,level=5):
+    @dec.slow
+    def test_args_kw(self):
         a = Foo()
         code = """
                py::tuple args(2);
@@ -568,7 +634,8 @@
         res = inline_tools.inline(code,['a'])
         assert_equal(res,(1,"hello",3))
         assert_equal(sys.getrefcount(res),2)
-    def check_std_noargs(self,level=5):
+    @dec.slow
+    def test_std_noargs(self):
         a = Foo()
         method = "bar"
         res = inline_tools.inline('return_val = a.mcall(method);',['a','method'])
@@ -579,7 +646,8 @@
         assert_equal(res,"bar results")
         second = sys.getrefcount(res)
         assert_equal(first,second)
-    def check_std_args(self,level=5):
+    @dec.slow
+    def test_std_args(self):
         a = Foo()
         method = "bar2"
         code = """
@@ -591,7 +659,8 @@
         res = inline_tools.inline(code,['a','method'])
         assert_equal(res,(1,"hello"))
         assert_equal(sys.getrefcount(res),2)
-    def check_std_args_kw(self,level=5):
+    @dec.slow
+    def test_std_args_kw(self):
         a = Foo()
         method = "bar3"
         code = """
@@ -605,7 +674,8 @@
         res = inline_tools.inline(code,['a','method'])
         assert_equal(res,(1,"hello",3))
         assert_equal(sys.getrefcount(res),2)
-    def check_noargs_with_args(self,level=5):
+    @dec.slow
+    def test_noargs_with_args(self):
         # calling a function that does take args with args
         # should fail.
         a = Foo()
@@ -627,8 +697,9 @@
         # first should == second, but the weird refcount error
         assert_equal(second,third)
 
-class TestObjectHash(NumpyTestCase):
-    def check_hash(self,level=5):
+class TestObjectHash(TestCase):
+    @dec.slow
+    def test_hash(self):
         class Foo:
             def __hash__(self):
                 return 123
@@ -637,42 +708,48 @@
         print 'hash:', res
         assert_equal(res,123)
 
-class TestObjectIsTrue(NumpyTestCase):
-    def check_true(self,level=5):
+class TestObjectIsTrue(TestCase):
+    @dec.slow
+    def test_true(self):
         class Foo:
             pass
         a= Foo()
         res = inline_tools.inline('return_val = a.is_true();',['a'])
         assert_equal(res,1)
-    def check_false(self,level=5):
+    @dec.slow
+    def test_false(self):
         a= None
         res = inline_tools.inline('return_val = a.is_true();',['a'])
         assert_equal(res,0)
 
-class TestObjectType(NumpyTestCase):
-    def check_type(self,level=5):
+class TestObjectType(TestCase):
+    @dec.slow
+    def test_type(self):
         class Foo:
             pass
         a= Foo()
         res = inline_tools.inline('return_val = a.type();',['a'])
         assert_equal(res,type(a))
 
-class TestObjectSize(NumpyTestCase):
-    def check_size(self,level=5):
+class TestObjectSize(TestCase):
+    @dec.slow
+    def test_size(self):
         class Foo:
             def __len__(self):
                 return 10
         a= Foo()
         res = inline_tools.inline('return_val = a.size();',['a'])
         assert_equal(res,len(a))
-    def check_len(self,level=5):
+    @dec.slow
+    def test_len(self):
         class Foo:
             def __len__(self):
                 return 10
         a= Foo()
         res = inline_tools.inline('return_val = a.len();',['a'])
         assert_equal(res,len(a))
-    def check_length(self,level=5):
+    @dec.slow
+    def test_length(self):
         class Foo:
             def __len__(self):
                 return 10
@@ -681,43 +758,50 @@
         assert_equal(res,len(a))
 
 from UserList import UserList
-class TestObjectSetItemOpIndex(NumpyTestCase):
-    def check_list_refcount(self,level=5):
+class TestObjectSetItemOpIndex(TestCase):
+    @dec.slow
+    def test_list_refcount(self):
         a = UserList([1,2,3])
         # temporary refcount fix until I understand why it incs by one.
         inline_tools.inline("a[1] = 1234;",['a'])
         before1 = sys.getrefcount(a)
         after1 = sys.getrefcount(a)
         assert_equal(after1,before1)
-    def check_set_int(self,level=5):
+    @dec.slow
+    def test_set_int(self):
         a = UserList([1,2,3])
         inline_tools.inline("a[1] = 1234;",['a'])
         assert_equal(sys.getrefcount(a[1]),2)
         assert_equal(a[1],1234)
-    def check_set_double(self,level=5):
+    @dec.slow
+    def test_set_double(self):
         a = UserList([1,2,3])
         inline_tools.inline("a[1] = 123.0;",['a'])
         assert_equal(sys.getrefcount(a[1]),2)
         assert_equal(a[1],123.0)
-    def check_set_char(self,level=5):
+    @dec.slow
+    def test_set_char(self):
         a = UserList([1,2,3])
         inline_tools.inline('a[1] = "bubba";',['a'])
         assert_equal(sys.getrefcount(a[1]),2)
         assert_equal(a[1],'bubba')
-    def check_set_string(self,level=5):
+    @dec.slow
+    def test_set_string(self):
         a = UserList([1,2,3])
         inline_tools.inline('a[1] = std::string("sissy");',['a'])
         assert_equal(sys.getrefcount(a[1]),2)
         assert_equal(a[1],'sissy')
-    def check_set_string(self,level=5):
+    @dec.slow
+    def test_set_string(self):
         a = UserList([1,2,3])
         inline_tools.inline('a[1] = std::complex<double>(1,1);',['a'])
         assert_equal(sys.getrefcount(a[1]),2)
         assert_equal(a[1],1+1j)
 
 from UserDict import UserDict
-class TestObjectSetItemOpKey(NumpyTestCase):
-    def check_key_refcount(self,level=5):
+class TestObjectSetItemOpKey(TestCase):
+    @dec.slow
+    def test_key_refcount(self):
         a = UserDict()
         code =  """
                 py::object one = 1;
@@ -751,7 +835,8 @@
         assert_equal(val[0] + 1, val[1])
         assert_equal(val[1], val[2])
 
-    def check_set_double_exists(self,level=5):
+    @dec.slow
+    def test_set_double_exists(self):
         a = UserDict()
         key = 10.0
         a[key] = 100.0
@@ -764,27 +849,31 @@
         assert_equal(sys.getrefcount(key),5)
         assert_equal(sys.getrefcount(a[key]),2)
         assert_equal(a[key],123.0)
-    def check_set_double_new(self,level=5):
+    @dec.slow
+    def test_set_double_new(self):
         a = UserDict()
         key = 1.0
         inline_tools.inline('a[key] = 123.0;',['a','key'])
         assert_equal(sys.getrefcount(key),4) # should be 3
         assert_equal(sys.getrefcount(a[key]),2)
         assert_equal(a[key],123.0)
-    def check_set_complex(self,level=5):
+    @dec.slow
+    def test_set_complex(self):
         a = UserDict()
         key = 1+1j
         inline_tools.inline("a[key] = 1234;",['a','key'])
         assert_equal(sys.getrefcount(key),4) # should be 3
         assert_equal(sys.getrefcount(a[key]),2)
         assert_equal(a[key],1234)
-    def check_set_char(self,level=5):
+    @dec.slow
+    def test_set_char(self):
         a = UserDict()
         inline_tools.inline('a["hello"] = 123.0;',['a'])
         assert_equal(sys.getrefcount(a["hello"]),2)
         assert_equal(a["hello"],123.0)
 
-    def check_set_class(self,level=5):
+    @dec.slow
+    def test_set_class(self):
         a = UserDict()
         class Foo:
             def __init__(self,val):
@@ -802,7 +891,8 @@
         assert_equal(sys.getrefcount(key),4)
         assert_equal(sys.getrefcount(a[key]),2)
         assert_equal(a[key],'bubba')
-    def check_set_from_member(self,level=5):
+    @dec.slow
+    def test_set_from_member(self):
         a = UserDict()
         a['first'] = 1
         a['second'] = 2
@@ -810,7 +900,4 @@
         assert_equal(a['first'],a['second'])
 
 if __name__ == "__main__":
-    import sys
-    if len(sys.argv) == 1:
-        sys.argv.extend(["--level=5"])
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_scxx_sequence.py
===================================================================
--- trunk/scipy/weave/tests/test_scxx_sequence.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_scxx_sequence.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -4,11 +4,11 @@
 import time
 import os,sys
 
-from numpy.testing import *
-set_package_path()
-from weave import inline_tools
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import inline_tools
+
+
 # Test:
 #     append            DONE
 #     insert            DONE
@@ -20,10 +20,11 @@
 
 from UserList import UserList
 
-class _TestSequenceBase(NumpyTestCase):
+class _TestSequenceBase(TestCase):
     seq_type = None
 
-    def check_conversion(self,level=5):
+    @dec.slow
+    def test_conversion(self):
         a = self.seq_type([1])
         before = sys.getrefcount(a)
         inline_tools.inline(" ",['a'])
@@ -35,7 +36,8 @@
         #print '2nd,3rd:', before, after
         assert(after == before)
 
-    def check_in(self,level=5):
+    @dec.slow
+    def test_in(self):
         """ Test the "in" method for lists.  We'll assume
             it works for sequences if it works here.
         """
@@ -87,7 +89,8 @@
         res = inline_tools.inline(code,['a'])
         assert res == 0
 
-    def check_count(self,level=5):
+    @dec.slow
+    def test_count(self):
         """ Test the "count" method for lists.  We'll assume
             it works for sequences if it works hre.
         """
@@ -121,7 +124,8 @@
         res = inline_tools.inline(code,['a'])
         assert res == 1
 
-    def check_access_speed(self,level=5):
+    @dec.slow
+    def test_access_speed(self):
         N = 1000000
         print '%s access -- val = a[i] for N =', (self.seq_type, N)
         a = self.seq_type([0]) * N
@@ -151,7 +155,8 @@
         print 'weave:', t2 - t1
 
 # Fails
-    def check_access_set_speed(self,level=5):
+    @dec.slow
+    def test_access_set_speed(self):
         N = 1000000
         print '%s access/set -- b[i] = a[i] for N =', (self.seq_type,N)
         a = self.seq_type([0]) * N
@@ -181,7 +186,8 @@
 class TestTuple(_TestSequenceBase):
     seq_type = tuple
 
-    def check_set_item_operator_equal_fail(self,level=5):
+    @dec.slow
+    def test_set_item_operator_equal_fail(self):
         # Tuples should only allow setting of variables
         # immediately after creation.
         a = (1,2,3)
@@ -189,7 +195,8 @@
             inline_tools.inline("a[1] = 1234;",['a'])
         except TypeError:
             pass
-    def check_set_item_operator_equal(self,level=5):
+    @dec.slow
+    def test_set_item_operator_equal(self):
         code = """
                py::tuple a(3);
                a[0] = 1;
@@ -202,7 +209,8 @@
         # returned value should only have a single refcount
         assert sys.getrefcount(a) == 2
 
-    def check_set_item_index_error(self,level=5):
+    @dec.slow
+    def test_set_item_index_error(self):
         code = """
                py::tuple a(3);
                a[4] = 1;
@@ -213,7 +221,8 @@
             assert 0
         except IndexError:
             pass
-    def check_get_item_operator_index_error(self,level=5):
+    @dec.slow
+    def test_get_item_operator_index_error(self):
         code = """
                py::tuple a(3);
                py::object b = a[4]; // should fail.
@@ -226,7 +235,8 @@
 
 class TestList(_TestSequenceBase):
     seq_type = list
-    def check_append_passed_item(self,level=5):
+    @dec.slow
+    def test_append_passed_item(self):
         a = []
         item = 1
 
@@ -243,7 +253,8 @@
         after2 = sys.getrefcount(item)
         assert after1 == before1
         assert after2 == before2
-    def check_append(self,level=5):
+    @dec.slow
+    def test_append(self):
         a = []
         # temporary refcount fix until I understand why it incs by one.
         inline_tools.inline("a.append(1);",['a'])
@@ -277,7 +288,8 @@
 
         after1 = sys.getrefcount(a)
         assert after1 == before1
-    def check_insert(self,level=5):
+    @dec.slow
+    def test_insert(self):
         a = [1,2,3]
 
         a.insert(1,234)
@@ -316,7 +328,8 @@
         after1 = sys.getrefcount(a)
         assert after1 == before1
 
-    def check_set_item_operator_equal(self,level=5):
+    @dec.slow
+    def test_set_item_operator_equal(self):
         a = self.seq_type([1,2,3])
         # temporary refcount fix until I understand why it incs by one.
         inline_tools.inline("a[1] = 1234;",['a'])
@@ -348,7 +361,8 @@
 
         after1 = sys.getrefcount(a)
         assert after1 == before1
-    def check_set_item_operator_equal_created(self,level=5):
+    @dec.slow
+    def test_set_item_operator_equal_created(self):
         code = """
                py::list a(3);
                a[0] = 1;
@@ -360,7 +374,8 @@
         assert a == [1,2,3]
         # returned value should only have a single refcount
         assert sys.getrefcount(a) == 2
-    def check_set_item_index_error(self,level=5):
+    @dec.slow
+    def test_set_item_index_error(self):
         code = """
                py::list a(3);
                a[4] = 1;
@@ -370,7 +385,8 @@
             assert 0
         except IndexError:
             pass
-    def check_get_item_index_error(self,level=5):
+    @dec.slow
+    def test_get_item_index_error(self):
         code = """
                py::list a(3);
                py::object o = a[4];
@@ -381,7 +397,8 @@
         except IndexError:
             pass
 
-    def check_string_add_speed(self,level=5):
+    @dec.slow
+    def test_string_add_speed(self):
         N = 1000000
         print 'string add -- b[i] = a[i] + "blah" for N =', N
         a = ["blah"] * N
@@ -407,7 +424,8 @@
         t2 = time.time()
         print 'weave:', t2 - t1
         assert b == desired
-    def check_int_add_speed(self,level=5):
+    @dec.slow
+    def test_int_add_speed(self):
         N = 1000000
         print 'int add -- b[i] = a[i] + 1 for N =', N
         a = [0] * N
@@ -434,4 +452,4 @@
         assert b == desired
 
 if __name__ == "__main__":
-    NumpyTest().test(10,10)
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_size_check.py
===================================================================
--- trunk/scipy/weave/tests/test_size_check.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_size_check.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,105 +1,105 @@
 import os
 from numpy import *
-from numpy.testing import *
-set_package_path()
-from weave import size_check
-from weave.ast_tools import *
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import size_check
+from scipy.weave.ast_tools import *
+
+
 import numpy as nx
 
 empty = array(())
 
 
-class TestMakeSameLength(NumpyTestCase):
+class TestMakeSameLength(TestCase):
 
-    def generic_test(self,x,y,desired):
+    def generic_check(self,x,y,desired):
         actual = size_check.make_same_length(x,y)
         desired = desired
         assert_array_equal(actual,desired)
 
-    def check_scalar(self):
+    def test_scalar(self):
         x,y = (),()
         desired = empty,empty
-        self.generic_test(x,y,desired)
-    def check_x_scalar(self):
+        self.generic_check(x,y,desired)
+    def test_x_scalar(self):
         x,y = (),(1,2)
         desired = array((1,1)),array((1,2))
-        self.generic_test(x,y,desired)
-    def check_y_scalar(self):
+        self.generic_check(x,y,desired)
+    def test_y_scalar(self):
         x,y = (1,2),()
         desired = array((1,2)),array((1,1))
-        self.generic_test(x,y,desired)
-    def check_x_short(self):
+        self.generic_check(x,y,desired)
+    def test_x_short(self):
         x,y = (1,2),(1,2,3)
         desired = array((1,1,2)),array((1,2,3))
-        self.generic_test(x,y,desired)
-    def check_y_short(self):
+        self.generic_check(x,y,desired)
+    def test_y_short(self):
         x,y = (1,2,3),(1,2)
         desired = array((1,2,3)),array((1,1,2))
-        self.generic_test(x,y,desired)
+        self.generic_check(x,y,desired)
 
-class TestBinaryOpSize(NumpyTestCase):
-    def generic_test(self,x,y,desired):
+class TestBinaryOpSize(TestCase):
+    def generic_check(self,x,y,desired):
         actual = size_check.binary_op_size(x,y)
         desired = desired
         assert_array_equal(actual,desired)
-    def generic_error_test(self,x,y):
+    def generic_error_check(self,x,y):
         self.failUnlessRaises(ValueError, size_check.binary_op_size, x, y)
 
     def desired_type(self,val):
         return array(val)
-    def check_scalar(self):
+    def test_scalar(self):
         x,y = (),()
         desired = self.desired_type(())
-        self.generic_test(x,y,desired)
-    def check_x1(self):
+        self.generic_check(x,y,desired)
+    def test_x1(self):
         x,y = (1,),()
         desired = self.desired_type((1,))
-        self.generic_test(x,y,desired)
-    def check_y1(self):
+        self.generic_check(x,y,desired)
+    def test_y1(self):
         x,y = (),(1,)
         desired = self.desired_type((1,))
-        self.generic_test(x,y,desired)
-    def check_x_y(self):
+        self.generic_check(x,y,desired)
+    def test_x_y(self):
         x,y = (5,),(5,)
         desired = self.desired_type((5,))
-        self.generic_test(x,y,desired)
-    def check_x_y2(self):
+        self.generic_check(x,y,desired)
+    def test_x_y2(self):
         x,y = (5,10),(5,10)
         desired = self.desired_type((5,10))
-        self.generic_test(x,y,desired)
-    def check_x_y3(self):
+        self.generic_check(x,y,desired)
+    def test_x_y3(self):
         x,y = (5,10),(1,10)
         desired = self.desired_type((5,10))
-        self.generic_test(x,y,desired)
-    def check_x_y4(self):
+        self.generic_check(x,y,desired)
+    def test_x_y4(self):
         x,y = (1,10),(5,10)
         desired = self.desired_type((5,10))
-        self.generic_test(x,y,desired)
-    def check_x_y5(self):
+        self.generic_check(x,y,desired)
+    def test_x_y5(self):
         x,y = (5,1),(1,10)
         desired = self.desired_type((5,10))
-        self.generic_test(x,y,desired)
-    def check_x_y6(self):
+        self.generic_check(x,y,desired)
+    def test_x_y6(self):
         x,y = (1,10),(5,1)
         desired = self.desired_type((5,10))
-        self.generic_test(x,y,desired)
-    def check_x_y7(self):
+        self.generic_check(x,y,desired)
+    def test_x_y7(self):
         x,y = (5,4,3,2,1),(3,2,1)
         desired = self.desired_type((5,4,3,2,1))
-        self.generic_test(x,y,desired)
+        self.generic_check(x,y,desired)
 
-    def check_error1(self):
+    def test_error1(self):
         x,y = (5,),(4,)
-        self.generic_error_test(x,y)
+        self.generic_error_check(x,y)
 
-    def check_error2(self):
+    def test_error2(self):
         x,y = (5,5),(4,5)
-        self.generic_error_test(x,y)
+        self.generic_error_check(x,y)
 
 class TestDummyArray(TestBinaryOpSize):
-    def generic_test(self,x,y,desired):
+    def generic_check(self,x,y,desired):
         if type(x) is type(()):
             x = ones(x)
         if type(y) is type(()):
@@ -115,8 +115,8 @@
     def desired_type(self,val):
         return size_check.dummy_array(array(val),1)
 
-class TestDummyArrayIndexing(NumpyTestCase):
-    def generic_test(self,ary,expr,desired):
+class TestDummyArrayIndexing(TestCase):
+    def generic_check(self,ary,expr,desired):
         a = size_check.dummy_array(ary)
         actual = eval(expr).shape
         #print desired, actual
@@ -124,7 +124,7 @@
     def generic_wrap(self,a,expr):
         desired = array(eval(expr).shape)
         try:
-            self.generic_test(a,expr,desired)
+            self.generic_check(a,expr,desired)
         except IndexError:
             if 0 not in desired:
                 msg = '%s raised IndexError in dummy_array, but forms\n' \
@@ -144,72 +144,72 @@
         a = arange(10)
         #print expr ,eval(expr)
         desired = array(())
-        self.generic_test(a,expr,desired)
-    def check_1d_index_0(self):
+        self.generic_check(a,expr,desired)
+    def test_1d_index_0(self):
         self.generic_1d_index('a[0]')
-    def check_1d_index_1(self):
+    def test_1d_index_1(self):
         self.generic_1d_index('a[4]')
-    def check_1d_index_2(self):
+    def test_1d_index_2(self):
         self.generic_1d_index('a[-4]')
-    def check_1d_index_3(self):
+    def test_1d_index_3(self):
         try: self.generic_1d('a[12]')
         except IndexError: pass
-    def check_1d_index_calculated(self):
+    def test_1d_index_calculated(self):
         self.generic_1d_index('a[0+1]')
-    def check_1d_0(self):
+    def test_1d_0(self):
         self.generic_1d('a[:]')
-    def check_1d_1(self):
+    def test_1d_1(self):
         self.generic_1d('a[1:]')
-    def check_1d_2(self):
+    def test_1d_2(self):
         self.generic_1d('a[-1:]')
-    def check_1d_3(self):
+    def test_1d_3(self):
         self.generic_1d('a[-11:]')
-    def check_1d_4(self):
+    def test_1d_4(self):
         self.generic_1d('a[:1]')
-    def check_1d_5(self):
+    def test_1d_5(self):
         self.generic_1d('a[:-1]')
-    def check_1d_6(self):
+    def test_1d_6(self):
         self.generic_1d('a[:-11]')
-    def check_1d_7(self):
+    def test_1d_7(self):
         self.generic_1d('a[1:5]')
-    def check_1d_8(self):
+    def test_1d_8(self):
         self.generic_1d('a[1:-5]')
-    def check_1d_9(self):
+    def test_1d_9(self):
         # don't support zero length slicing at the moment.
         try: self.generic_1d('a[-1:-5]')
         except IndexError: pass
-    def check_1d_10(self):
+    def test_1d_10(self):
         self.generic_1d('a[-5:-1]')
 
-    def check_1d_stride_0(self):
+    def test_1d_stride_0(self):
         self.generic_1d('a[::1]')
-    def check_1d_stride_1(self):
+    def test_1d_stride_1(self):
         self.generic_1d('a[::-1]')
-    def check_1d_stride_2(self):
+    def test_1d_stride_2(self):
         self.generic_1d('a[1::1]')
-    def check_1d_stride_3(self):
+    def test_1d_stride_3(self):
         self.generic_1d('a[1::-1]')
-    def check_1d_stride_4(self):
+    def test_1d_stride_4(self):
         # don't support zero length slicing at the moment.
         try: self.generic_1d('a[1:5:-1]')
         except IndexError: pass
-    def check_1d_stride_5(self):
+    def test_1d_stride_5(self):
         self.generic_1d('a[5:1:-1]')
-    def check_1d_stride_6(self):
+    def test_1d_stride_6(self):
         self.generic_1d('a[:4:1]')
-    def check_1d_stride_7(self):
+    def test_1d_stride_7(self):
         self.generic_1d('a[:4:-1]')
-    def check_1d_stride_8(self):
+    def test_1d_stride_8(self):
         self.generic_1d('a[:-4:1]')
-    def check_1d_stride_9(self):
+    def test_1d_stride_9(self):
         self.generic_1d('a[:-4:-1]')
-    def check_1d_stride_10(self):
+    def test_1d_stride_10(self):
         self.generic_1d('a[:-3:2]')
-    def check_1d_stride_11(self):
+    def test_1d_stride_11(self):
         self.generic_1d('a[:-3:-2]')
-    def check_1d_stride_12(self):
+    def test_1d_stride_12(self):
         self.generic_1d('a[:-3:-7]')
-    def check_1d_random(self):
+    def test_1d_random(self):
         """ through a bunch of different indexes at it for good measure.
         """
         import random
@@ -224,13 +224,13 @@
             except IndexError:
                 pass
 
-    def check_2d_0(self):
+    def test_2d_0(self):
         self.generic_2d('a[:]')
-    def check_2d_1(self):
+    def test_2d_1(self):
         self.generic_2d('a[:2]')
-    def check_2d_2(self):
+    def test_2d_2(self):
         self.generic_2d('a[:,:]')
-    def check_2d_random(self):
+    def test_2d_random(self):
         """ through a bunch of different indexes at it for good measure.
         """
         import random
@@ -249,7 +249,7 @@
                 self.generic_2d(expr)
             except IndexError:
                 pass
-    def check_3d_random(self):
+    def test_3d_random(self):
         """ through a bunch of different indexes at it for good measure.
         """
         import random
@@ -267,42 +267,42 @@
             except IndexError:
                 pass
 
-class TestReduction(NumpyTestCase):
-    def check_1d_0(self):
+class TestReduction(TestCase):
+    def test_1d_0(self):
         a = ones((5,))
         actual = size_check.reduction(a,0)
         desired = size_check.dummy_array((),1)
         assert_array_equal(actual.shape,desired.shape)
-    def check_2d_0(self):
+    def test_2d_0(self):
         a = ones((5,10))
         actual = size_check.reduction(a,0)
         desired = size_check.dummy_array((10,),1)
         assert_array_equal(actual.shape,desired.shape)
-    def check_2d_1(self):
+    def test_2d_1(self):
         a = ones((5,10))
         actual = size_check.reduction(a,1)
         desired = size_check.dummy_array((5,),1)
         assert_array_equal(actual.shape,desired.shape)
-    def check_3d_0(self):
+    def test_3d_0(self):
         a = ones((5,6,7))
         actual = size_check.reduction(a,1)
         desired = size_check.dummy_array((5,7),1)
         assert_array_equal(actual.shape,desired.shape)
-    def check_error0(self):
+    def test_error0(self):
         a = ones((5,))
         try:
             actual = size_check.reduction(a,-2)
         except ValueError:
             pass
-    def check_error1(self):
+    def test_error1(self):
         a = ones((5,))
         try:
             actual = size_check.reduction(a,1)
         except ValueError:
             pass
 
-class TestExpressions(NumpyTestCase):
-    def generic_test(self,expr,desired,**kw):
+class TestExpressions(TestCase):
+    def generic_check(self,expr,desired,**kw):
         import parser
         ast_list = parser.expr(expr).tolist()
         args = harvest_variables(ast_list)
@@ -331,8 +331,8 @@
                 desired = zeros(())
         except:
             desired = 'failed'
-        self.generic_test(expr,desired,**kw)
-    def check_generic_1d(self):
+        self.generic_check(expr,desired,**kw)
+    def test_generic_1d(self):
         a = arange(10)
         expr = 'a[:]'
         self.generic_wrap(expr,a=a)
@@ -346,17 +346,17 @@
         self.generic_wrap(expr,a=a,b=b)
         bad_expr = 'a[:5] + b'
         self.generic_wrap(bad_expr,a=a,b=b)
-    def check_single_index(self):
+    def test_single_index(self):
         a = arange(10)
         expr = 'a[5] + a[3]'
         self.generic_wrap(expr,a=a)
 
-    def check_calculated_index(self):
+    def test_calculated_index(self):
         a = arange(10)
         nx = 0
         expr = 'a[5] + a[nx+3]'
         size_check.check_expr(expr,locals())
-    def check_calculated_index2(self):
+    def test_calculated_index2(self):
         a = arange(10)
         nx = 0
         expr = 'a[1:5] + a[nx+1:5+nx]'
@@ -370,4 +370,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest('weave.size_check').run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_slice_handler.py
===================================================================
--- trunk/scipy/weave/tests/test_slice_handler.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_slice_handler.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,11 +1,11 @@
 
-from numpy.testing import *
-set_package_path()
-from weave import slice_handler
-from weave.slice_handler import indexed_array_pattern
-from weave.ast_tools import *
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import slice_handler
+from scipy.weave.slice_handler import indexed_array_pattern
+from scipy.weave.ast_tools import *
+
+
 def print_assert_equal(test_string,actual,desired):
     """this should probably be in scipy_test.testing
     """
@@ -22,21 +22,21 @@
         pprint.pprint(desired,msg)
         raise AssertionError, msg.getvalue()
 
-class TestBuildSliceAtom(NumpyTestCase):
-    def generic_test(self,slice_vars,desired):
+class TestBuildSliceAtom(TestCase):
+    def generic_check(self,slice_vars,desired):
         pos = slice_vars['pos']
         ast_list = slice_handler.build_slice_atom(slice_vars,pos)
         actual = ast_to_string(ast_list)
         print_assert_equal('',actual,desired)
-    def check_exclusive_end(self):
+    def test_exclusive_end(self):
         slice_vars = {'begin':'1', 'end':'2', 'step':'_stp',
                       'single_index':'_index','pos':0}
         desired = 'slice(1,2-1)'
-        self.generic_test(slice_vars,desired)
+        self.generic_check(slice_vars,desired)
 
-class TestSlice(NumpyTestCase):
+class TestSlice(TestCase):
 
-    def generic_test(self,suite_string,desired):
+    def generic_check(self,suite_string,desired):
         import parser
         ast_tuple = parser.suite(suite_string).totuple()
         found, data = find_first_pattern(ast_tuple,indexed_array_pattern)
@@ -44,89 +44,89 @@
         actual = slice_handler.slice_ast_to_dict(subscript)
         print_assert_equal(suite_string,actual,desired)
 
-    def check_empty_2_slice(self):
+    def test_empty_2_slice(self):
         """match slice from a[:]"""
         test ="a[:]"
         desired = {'begin':'_beg', 'end':'_end', 'step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_begin_2_slice(self):
+        self.generic_check(test,desired)
+    def test_begin_2_slice(self):
         """match slice from a[1:]"""
         test ="a[1:]"
         desired = {'begin':'1', 'end':'_end', 'step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_end_2_slice(self):
+        self.generic_check(test,desired)
+    def test_end_2_slice(self):
         """match slice from a[:2]"""
         test ="a[:2]"
         desired = {'begin':'_beg', 'end':'2', 'step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_begin_end_2_slice(self):
+        self.generic_check(test,desired)
+    def test_begin_end_2_slice(self):
         """match slice from a[1:2]"""
         test ="a[1:2]"
         desired = {'begin':'1', 'end':'2', 'step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_empty_3_slice(self):
+        self.generic_check(test,desired)
+    def test_empty_3_slice(self):
         """match slice from a[::]"""
         test ="a[::]"
         desired = {'begin':'_beg', 'end':'_end', 'step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_begin_3_slice(self):
+        self.generic_check(test,desired)
+    def test_begin_3_slice(self):
         """match slice from a[1::]"""
         test ="a[1::]"
         desired = {'begin':'1', 'end':'_end', 'step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_end_3_slice(self):
+        self.generic_check(test,desired)
+    def test_end_3_slice(self):
         """match slice from a[:2:]"""
         test ="a[:2:]"
         desired = {'begin':'_beg', 'end':'2', 'step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_stp3_slice(self):
+        self.generic_check(test,desired)
+    def test_stp3_slice(self):
         """match slice from a[::3]"""
         test ="a[::3]"
         desired = {'begin':'_beg', 'end':'_end', 'step':'3',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_begin_end_3_slice(self):
+        self.generic_check(test,desired)
+    def test_begin_end_3_slice(self):
         """match slice from a[1:2:]"""
         test ="a[1:2:]"
         desired = {'begin':'1', 'end':'2','step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_begin_step_3_slice(self):
+        self.generic_check(test,desired)
+    def test_begin_step_3_slice(self):
         """match slice from a[1::3]"""
         test ="a[1::3]"
         desired = {'begin':'1', 'end':'_end','step':'3',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_end_step_3_slice(self):
+        self.generic_check(test,desired)
+    def test_end_step_3_slice(self):
         """match slice from a[:2:3]"""
         test ="a[:2:3]"
         desired = {'begin':'_beg', 'end':'2', 'step':'3',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_begin_end_stp3_slice(self):
+        self.generic_check(test,desired)
+    def test_begin_end_stp3_slice(self):
         """match slice from a[1:2:3]"""
         test ="a[1:2:3]"
         desired = {'begin':'1', 'end':'2', 'step':'3','single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_expr_3_slice(self):
+        self.generic_check(test,desired)
+    def test_expr_3_slice(self):
         """match slice from a[:1+i+2:]"""
         test ="a[:1+i+2:]"
         desired = {'begin':'_beg', 'end':"1+i+2",'step':'_stp',
                    'single_index':'_index'}
-        self.generic_test(test,desired)
-    def check_single_index(self):
+        self.generic_check(test,desired)
+    def test_single_index(self):
         """match slice from a[0]"""
         test ="a[0]"
         desired = {'begin':'_beg', 'end':"_end",'step':'_stp',
                    'single_index':'0'}
-        self.generic_test(test,desired)
+        self.generic_check(test,desired)
 
 def replace_whitespace(in_str):
     out = in_str.replace(" ","")
@@ -134,8 +134,8 @@
     out = out.replace("\n","")
     return out
 
-class TestTransformSlices(NumpyTestCase):
-    def generic_test(self,suite_string,desired):
+class TestTransformSlices(TestCase):
+    def generic_check(self,suite_string,desired):
         import parser
         ast_list = parser.suite(suite_string).tolist()
         slice_handler.transform_slices(ast_list)
@@ -146,20 +146,20 @@
         desired = replace_whitespace(desired)
         print_assert_equal(suite_string,actual,desired)
 
-    def check_simple_expr(self):
+    def test_simple_expr(self):
         """transform a[:] to slice notation"""
         test ="a[:]"
         desired = 'a[slice(_beg,_end,_stp)]'
-        self.generic_test(test,desired)
-    def check_simple_expr(self):
+        self.generic_check(test,desired)
+    def test_simple_expr(self):
         """transform a[:,:] = b[:,1:1+2:3] *(c[1-2+i:,:] - c[:,:])"""
         test ="a[:,:] = b[:,1:1+2:3] *(c[1-2+i:,:] - c[:,:])"
         desired = " a[slice(_beg,_end),slice(_beg,_end)] = "\
                                     " b[slice(_beg,_end), slice(1,1+2-1,3)] *"\
                                     " (c[slice(1-2+i,_end), slice(_beg,_end)] -"\
                                     "  c[slice(_beg,_end), slice(_beg,_end)])"
-        self.generic_test(test,desired)
+        self.generic_check(test,desired)
 
 
 if __name__ == "__main__":
-    NumpyTest('weave.slice_handler').run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_standard_array_spec.py
===================================================================
--- trunk/scipy/weave/tests/test_standard_array_spec.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_standard_array_spec.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -1,10 +1,9 @@
 
 from numpy import *
-from numpy.testing import *
-set_package_path()
-from weave import standard_array_spec
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import standard_array_spec
+
 def remove_whitespace(in_str):
     out = in_str.replace(" ","")
     out = out.replace("\t","")
@@ -27,16 +26,16 @@
         pprint.pprint(desired,msg)
         raise AssertionError, msg.getvalue()
 
-class TestArrayConverter(NumpyTestCase):
-    def check_type_match_string(self):
+class TestArrayConverter(TestCase):
+    def test_type_match_string(self):
         s = standard_array_spec.array_converter()
         assert( not s.type_match('string') )
-    def check_type_match_int(self):
+    def test_type_match_int(self):
         s = standard_array_spec.array_converter()
         assert(not s.type_match(5))
-    def check_type_match_array(self):
+    def test_type_match_array(self):
         s = standard_array_spec.array_converter()
         assert(s.type_match(arange(4)))
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: trunk/scipy/weave/tests/test_wx_spec.py
===================================================================
--- trunk/scipy/weave/tests/test_wx_spec.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/test_wx_spec.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -8,38 +8,45 @@
                 then returned as a function return value correctly
 """
 
-from numpy.testing import *
-set_package_path()
-from weave import ext_tools, wx_spec
-restore_path()
+from scipy.testing import *
 
+from scipy.weave import ext_tools, wx_spec
+
+
 import wx
 
-class TestWxConverter(NumpyTestCase):
+class TestWxConverter(TestCase):
     def setUp(self):
         self.app = wx.App()
         self.s = wx_spec.wx_converter()
 
-    def check_type_match_string(self,level=5):
+    @dec.slow
+    def test_type_match_string(self):
         assert(not self.s.type_match('string') )
 
-    def check_type_match_int(self,level=5):
+    @dec.slow
+    def test_type_match_int(self):
         assert(not self.s.type_match(5))
 
-    def check_type_match_float(self,level=5):
+    @dec.slow
+    def test_type_match_float(self):
         assert(not self.s.type_match(5.))
 
-    def check_type_match_complex(self,level=5):
+    @dec.slow
+    def test_type_match_complex(self):
         assert(not self.s.type_match(5.+1j))
 
-    def check_type_match_complex(self,level=5):
+    @dec.slow
+    def test_type_match_complex(self):
         assert(not self.s.type_match(5.+1j))
 
-    def check_type_match_wxframe(self,level=5):
+    @dec.slow
+    def test_type_match_wxframe(self):
         f=wx.Frame(None,-1,'bob')
         assert(self.s.type_match(f))
 
-    def check_var_in(self,level=5):
+    @dec.slow
+    def test_var_in(self):
         mod = ext_tools.ext_module('wx_var_in',compiler='')
         mod.customize.add_header('<wx/string.h>')
         mod.customize.add_extra_compile_arg(' '.join(self.s.extra_compile_args))
@@ -69,7 +76,8 @@
         except AttributeError:
             pass
 
-    def no_check_var_local(self,level=5):
+    @dec.slow
+    def no_check_var_local(self):
         mod = ext_tools.ext_module('wx_var_local')
         a = 'string'
         code = 'a="hello";'
@@ -83,7 +91,8 @@
         wx_var_local.test(b,q)
         assert('a' == 'string')
 
-    def no_test_no_check_return(self,level=5):
+    @dec.slow
+    def no_test_no_check_return(self):
         mod = ext_tools.ext_module('wx_return')
         a = 'string'
         code = """
@@ -99,7 +108,4 @@
         assert(c == 'hello')
 
 if __name__ == "__main__":
-    import sys
-    if len(sys.argv) == 1:
-        sys.argv.extend(["--level=5"])
-    NumpyTest().test(10,10)
+    unittest.main()

Modified: trunk/scipy/weave/tests/weave_test_utils.py
===================================================================
--- trunk/scipy/weave/tests/weave_test_utils.py	2008-01-12 09:23:49 UTC (rev 3821)
+++ trunk/scipy/weave/tests/weave_test_utils.py	2008-01-12 10:06:39 UTC (rev 3822)
@@ -28,10 +28,7 @@
 # mainly used by catalog tests
 ###################################################
 
-from numpy.testing import set_package_path, restore_path
-set_package_path()
-from weave import catalog
-restore_path()
+from scipy.weave import catalog
 
 import glob
 



More information about the Scipy-svn mailing list