[Scipy-svn] r3764 - in branches/testing_cleanup: . scipy/linsolve/umfpack/tests scipy/maxentropy/tests scipy/misc/tests scipy/odr/tests scipy/optimize/tests scipy/signal/tests scipy/sparse/tests scipy/special/tests scipy/stats/models/tests scipy/stats/tests

scipy-svn@scip... scipy-svn@scip...
Wed Jan 2 01:57:35 CST 2008


Author: matthew.brett@gmail.com
Date: 2008-01-02 01:54:58 -0600 (Wed, 02 Jan 2008)
New Revision: 3764

Modified:
   branches/testing_cleanup/INSTALL.txt
   branches/testing_cleanup/scipy/linsolve/umfpack/tests/test_umfpack.py
   branches/testing_cleanup/scipy/maxentropy/tests/test_maxentropy.py
   branches/testing_cleanup/scipy/misc/tests/test_pilutil.py
   branches/testing_cleanup/scipy/odr/tests/test_odr.py
   branches/testing_cleanup/scipy/optimize/tests/test_cobyla.py
   branches/testing_cleanup/scipy/optimize/tests/test_nonlin.py
   branches/testing_cleanup/scipy/optimize/tests/test_optimize.py
   branches/testing_cleanup/scipy/optimize/tests/test_slsqp.py
   branches/testing_cleanup/scipy/optimize/tests/test_zeros.py
   branches/testing_cleanup/scipy/signal/tests/test_signaltools.py
   branches/testing_cleanup/scipy/signal/tests/test_wavelets.py
   branches/testing_cleanup/scipy/sparse/tests/test_base.py
   branches/testing_cleanup/scipy/sparse/tests/test_construct.py
   branches/testing_cleanup/scipy/sparse/tests/test_sparse.py
   branches/testing_cleanup/scipy/sparse/tests/test_sputils.py
   branches/testing_cleanup/scipy/special/tests/test_basic.py
   branches/testing_cleanup/scipy/special/tests/test_spfun_stats.py
   branches/testing_cleanup/scipy/stats/models/tests/test_bspline.py
   branches/testing_cleanup/scipy/stats/models/tests/test_formula.py
   branches/testing_cleanup/scipy/stats/models/tests/test_glm.py
   branches/testing_cleanup/scipy/stats/models/tests/test_regression.py
   branches/testing_cleanup/scipy/stats/models/tests/test_rlm.py
   branches/testing_cleanup/scipy/stats/models/tests/test_scale.py
   branches/testing_cleanup/scipy/stats/models/tests/test_utils.py
   branches/testing_cleanup/scipy/stats/tests/test_distributions.py
   branches/testing_cleanup/scipy/stats/tests/test_morestats.py
   branches/testing_cleanup/scipy/stats/tests/test_stats.py
Log:
Slowly working through, sandbox omitted, stats in progress

Modified: branches/testing_cleanup/INSTALL.txt
===================================================================
--- branches/testing_cleanup/INSTALL.txt	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/INSTALL.txt	2008-01-02 07:54:58 UTC (rev 3764)
@@ -20,7 +20,7 @@
 
 SciPy requires the following software installed:
 
-1) Python__ 2.3.x or newer
+1) Python__ 2.4.x or newer
 
    Debian packages: python python-dev
 
@@ -32,7 +32,7 @@
 
 __ http://www.python.org
 
-2) NumPy__ 1.0b1 or newer
+2) NumPy__ 1.0.5 or newer
 
    Debian package: python-numpy
 

Modified: branches/testing_cleanup/scipy/linsolve/umfpack/tests/test_umfpack.py
===================================================================
--- branches/testing_cleanup/scipy/linsolve/umfpack/tests/test_umfpack.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/linsolve/umfpack/tests/test_umfpack.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -8,20 +8,20 @@
 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()
 
-class TestSolvers(NumpyTestCase):
+
+class TestSolvers(TestCase):
     """Tests inverting a sparse linear system"""
 
-    def check_solve_complex_without_umfpack(self):
+    def test_solve_complex_without_umfpack(self):
         """Solve: single precision complex"""
         linsolve.use_solver( useUmfpack = False )
         a = self.a.astype('F')
@@ -32,7 +32,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 +43,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 +53,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 +63,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 +73,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 +84,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 +104,10 @@
 
 
 
-class TestFactorization(NumpyTestCase):
+class TestFactorization(TestCase):
     """Tests factorizing a sparse linear system"""
 
-    def check_complex_lu(self):
+    def test_complex_lu(self):
         """Getting factors of complex matrix"""
         umfpack = um.UmfpackContext("zi")
 
@@ -126,7 +126,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 +166,4 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: branches/testing_cleanup/scipy/maxentropy/tests/test_maxentropy.py
===================================================================
--- branches/testing_cleanup/scipy/maxentropy/tests/test_maxentropy.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/maxentropy/tests/test_maxentropy.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/misc/tests/test_pilutil.py
===================================================================
--- branches/testing_cleanup/scipy/misc/tests/test_pilutil.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/misc/tests/test_pilutil.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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
+    
+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
 
-        return ((self.tst_fromimage,os.path.join(datapath,'data',fn),irange)
-                for fn,irange in data.iteritems())
-
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: branches/testing_cleanup/scipy/odr/tests/test_odr.py
===================================================================
--- branches/testing_cleanup/scipy/odr/tests/test_odr.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/odr/tests/test_odr.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/optimize/tests/test_cobyla.py
===================================================================
--- branches/testing_cleanup/scipy/optimize/tests/test_cobyla.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/optimize/tests/test_cobyla.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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, level=1):
 
         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: branches/testing_cleanup/scipy/optimize/tests/test_nonlin.py
===================================================================
--- branches/testing_cleanup/scipy/optimize/tests/test_nonlin.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/optimize/tests/test_nonlin.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/optimize/tests/test_optimize.py
===================================================================
--- branches/testing_cleanup/scipy/optimize/tests/test_optimize.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/optimize/tests/test_optimize.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/optimize/tests/test_slsqp.py
===================================================================
--- branches/testing_cleanup/scipy/optimize/tests/test_slsqp.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/optimize/tests/test_slsqp.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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])
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: branches/testing_cleanup/scipy/optimize/tests/test_zeros.py
===================================================================
--- branches/testing_cleanup/scipy/optimize/tests/test_zeros.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/optimize/tests/test_zeros.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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,14 +60,14 @@
             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):
         a = .5
@@ -93,4 +92,4 @@
             print '\n\n'
 
 if __name__ == '__main__' :
-    NumpyTest().run()
+    unittest.main()

Modified: branches/testing_cleanup/scipy/signal/tests/test_signaltools.py
===================================================================
--- branches/testing_cleanup/scipy/signal/tests/test_signaltools.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/signal/tests/test_signaltools.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/signal/tests/test_wavelets.py
===================================================================
--- branches/testing_cleanup/scipy/signal/tests/test_wavelets.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/signal/tests/test_wavelets.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/sparse/tests/test_base.py
===================================================================
--- branches/testing_cleanup/scipy/sparse/tests/test_base.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/sparse/tests/test_base.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -18,15 +18,15 @@
         asarray, vstack, ndarray, kron
 
 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
 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
@@ -38,11 +38,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)
@@ -59,15 +59,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())
@@ -75,7 +75,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())
@@ -83,13 +83,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.])
@@ -101,7 +101,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)
@@ -115,36 +115,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]])
 
@@ -154,14 +154,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)
 
@@ -169,7 +169,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 )
 
@@ -185,13 +185,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)
@@ -237,7 +237,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')
@@ -288,7 +288,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)
 
@@ -301,7 +301,7 @@
             assert_equal( result.shape, (4,2) )
             assert_equal( result, dot(a,b) )
 
-    def check_conversions(self):
+    def test_conversions(self):
         A = spkron([[1,0,1],[0,1,1],[1,0,0]], [[1,1],[0,1]] )
         D = A.todense()
         A = self.spmatrix(A)
@@ -321,11 +321,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)
@@ -338,7 +338,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)
@@ -347,7 +347,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
@@ -355,7 +355,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
@@ -364,7 +364,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
@@ -394,20 +394,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
         """
@@ -422,7 +422,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())
@@ -431,7 +431,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())
@@ -443,7 +443,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')
@@ -481,7 +481,7 @@
         assert_equal((self.datsp*x).dtype,y.dtype)
 
 class _TestGetSet:
-    def check_setelement(self):
+    def test_setelement(self):
         a = self.spmatrix((3,4))
         a[1,2] = 4.0
         a[0,1] = 3
@@ -490,14 +490,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)
         """
@@ -521,7 +521,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)
@@ -555,7 +555,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)
@@ -592,7 +592,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())
@@ -610,13 +610,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)
@@ -658,7 +658,7 @@
         self.dtypes =  ['int8','uint8','int16','int32','int64',
                         'float32','float64','complex64','complex128']
 
-    def check_conversion(self):
+    def test_conversion(self):
         self.arith_init()
 
         #check whether dtype and value is preserved in conversion
@@ -673,7 +673,7 @@
             assert_array_equal(A,Asp.todense())
             assert_array_equal(B,Bsp.todense())
 
-    def check_add_sub(self):
+    def test_add_sub(self):
         self.arith_init()
 
         #basic tests
@@ -707,7 +707,7 @@
                 assert_array_equal(D1,A - Bsp)          #check dense - sparse
 
 
-    def check_mu(self):
+    def test_mu(self):
         self.arith_init()
 
         #basic tests
@@ -732,10 +732,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')
@@ -747,7 +747,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)
@@ -756,7 +756,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')
@@ -767,7 +767,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' )
@@ -783,7 +783,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])
@@ -794,7 +794,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])
@@ -803,7 +803,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] )
@@ -813,7 +813,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 = csr_matrix( array([[1,2,3,4],[1,2,3,5],[0,2,0,1]]) )
         i0 = slice( 0, 2 )
         i1 = ( 1, 3 )
@@ -829,10 +829,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])
@@ -842,7 +842,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)
@@ -850,14 +850,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])
@@ -868,7 +868,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])
@@ -876,7 +876,7 @@
         csc = csc_matrix((data, indices, indptr))
         assert_array_equal(csc.shape,(6,3))
     
-    def check_sort_indices(self):
+    def test_sort_indices(self):
         data = arange( 5 )
         row = array( [7, 2, 1, 5, 4] )
         ptr = [0, 3, 5]
@@ -886,7 +886,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 )
@@ -899,10 +899,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
@@ -910,7 +910,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
@@ -918,7 +918,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)
@@ -950,7 +950,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)
@@ -1009,7 +1009,7 @@
 class TestLIL( _TestCommon, _TestHorizSlicing, _TestVertSlicing, 
         _TestBothSlicing, _TestGetSet, _TestSolve,
         _TestArithmetic, _TestInplaceArithmetic,
-        NumpyTestCase):
+        TestCase):
     spmatrix = lil_matrix
 
     B = lil_matrix((4,3))
@@ -1018,7 +1018,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
@@ -1029,7 +1029,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
 
@@ -1039,7 +1039,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
@@ -1050,7 +1050,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.
         """
@@ -1078,7 +1078,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
@@ -1096,7 +1096,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')
 
@@ -1109,13 +1109,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.
         """
@@ -1129,7 +1129,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
@@ -1154,9 +1154,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])
@@ -1167,7 +1167,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])
@@ -1178,7 +1178,7 @@
 
         assert_array_equal(mat,coo.todense())
 
-    def check_constructor3(self):
+    def test_constructor3(self):
         """empty matrix"""
         coo = coo_matrix( (4,3) )
 
@@ -1188,7 +1188,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],
@@ -1202,19 +1202,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])
@@ -1237,7 +1237,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
@@ -1264,4 +1264,4 @@
 
                 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()

Modified: branches/testing_cleanup/scipy/sparse/tests/test_construct.py
===================================================================
--- branches/testing_cleanup/scipy/sparse/tests/test_construct.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/sparse/tests/test_construct.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -1,16 +1,16 @@
 """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()
 
-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]] )
@@ -58,12 +58,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)
@@ -76,7 +76,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]]))
@@ -100,7 +100,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],
@@ -132,5 +132,5 @@
                             [6,5,0]])
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()
 

Modified: branches/testing_cleanup/scipy/sparse/tests/test_sparse.py
===================================================================
--- branches/testing_cleanup/scipy/sparse/tests/test_sparse.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/sparse/tests/test_sparse.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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,10 @@
     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=4):
+    def bench_arithmetic(self):
         matrices = []
         #matrices.append( ('A','Identity', spidentity(500**2,format='csr')) )
         matrices.append( ('A','Poisson5pt', poisson2d(500,format='csr'))  )
@@ -94,7 +94,7 @@
 
   
 
-    def bench_sort(self,level=5):
+    def bench_sort(self):
         """sort CSR column indices"""
         matrices = []
         matrices.append( ('Rand10',  1e4,  10) )
@@ -127,7 +127,7 @@
             print fmt % (A.format,name,shape,A.nnz,1e3*(end-start)/float(iter) )
 
 
-    def bench_matvec(self,level=5):
+    def bench_matvec(self):
         matrices = []
         matrices.append(('Identity',   spidentity(10**4,format='dia')))
         matrices.append(('Identity',   spidentity(10**4,format='csr')))
@@ -174,7 +174,7 @@
 
             print fmt % (A.format,name,shape,A.nnz,MFLOPs)
             
-    def bench_construction(self,level=5):
+    def bench_construction(self):
         """build matrices by inserting single values"""
         matrices = []
         matrices.append( ('Empty',csr_matrix((10000,10000))) )
@@ -210,7 +210,7 @@
                 print fmt % (format,name,shape,A.nnz,(end-start)/float(iter))
 
 
-    def bench_conversion(self,level=5):
+    def bench_conversion(self):
         A = poisson2d(100)
 
         formats = ['csr','csc','coo','lil','dok']
@@ -251,8 +251,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
@@ -279,5 +279,5 @@
 
 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()
 

Modified: branches/testing_cleanup/scipy/sparse/tests/test_sputils.py
===================================================================
--- branches/testing_cleanup/scipy/sparse/tests/test_sputils.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/sparse/tests/test_sputils.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -2,28 +2,28 @@
 
 import numpy
 
-from numpy.testing import *
-set_package_path()
+from scipy.testing import *
+
 from scipy.sparse.sputils import *
-restore_path()
 
 
 
-class TestSparseUtils(NumpyTestCase):
 
-    def check_upcast(self):
+class TestSparseUtils(TestCase):
+
+    def test_upcast(self):
         assert_equal(upcast('int32'),numpy.int32)
         assert_equal(upcast('int32','float32'),numpy.float64)
         assert_equal(upcast('bool',complex,float),numpy.complex128)
         assert_equal(upcast('i','d'),numpy.float64)
 
-    def check_getdtype(self):
+    def test_getdtype(self):
         A = numpy.array([1],dtype='int8')
 
         assert_equal(getdtype(None,default=float),numpy.float)
         assert_equal(getdtype(None,a=A),numpy.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 +36,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(numpy.array(3)),True)
@@ -47,7 +47,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 +56,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 +66,11 @@
         assert_equal(issequence( numpy.array([[1],[2],[3]]) ),False)
         assert_equal(issequence( 3 ),False)
 
-    def check_isdense(self):
+    def test_isdense(self):
         assert_equal(isdense( numpy.array([1]) ),True)
         assert_equal(isdense( numpy.matrix([1]) ),True)
                 
 if __name__ == "__main__":
-    NumpyTest().run()
+    unittest.main()
 
 

Modified: branches/testing_cleanup/scipy/special/tests/test_basic.py
===================================================================
--- branches/testing_cleanup/scipy/special/tests/test_basic.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/special/tests/test_basic.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/special/tests/test_spfun_stats.py
===================================================================
--- branches/testing_cleanup/scipy/special/tests/test_spfun_stats.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/special/tests/test_spfun_stats.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/stats/models/tests/test_bspline.py
===================================================================
--- branches/testing_cleanup/scipy/stats/models/tests/test_bspline.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/models/tests/test_bspline.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/stats/models/tests/test_formula.py
===================================================================
--- branches/testing_cleanup/scipy/stats/models/tests/test_formula.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/models/tests/test_formula.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/stats/models/tests/test_glm.py
===================================================================
--- branches/testing_cleanup/scipy/stats/models/tests/test_glm.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/models/tests/test_glm.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/stats/models/tests/test_regression.py
===================================================================
--- branches/testing_cleanup/scipy/stats/models/tests/test_regression.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/models/tests/test_regression.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/stats/models/tests/test_rlm.py
===================================================================
--- branches/testing_cleanup/scipy/stats/models/tests/test_rlm.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/models/tests/test_rlm.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/stats/models/tests/test_scale.py
===================================================================
--- branches/testing_cleanup/scipy/stats/models/tests/test_scale.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/models/tests/test_scale.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/stats/models/tests/test_utils.py
===================================================================
--- branches/testing_cleanup/scipy/stats/models/tests/test_utils.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/models/tests/test_utils.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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: branches/testing_cleanup/scipy/stats/tests/test_distributions.py
===================================================================
--- branches/testing_cleanup/scipy/stats/tests/test_distributions.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/tests/test_distributions.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -3,17 +3,17 @@
 """
 
 
-from numpy.testing import *
+from scipy.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 +27,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 +39,40 @@
          '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(dit,'',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 genererator
+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 +84,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 +108,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 +118,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 +128,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 +138,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 +150,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 +161,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 +171,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 +181,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 +191,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 +200,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 +211,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: branches/testing_cleanup/scipy/stats/tests/test_morestats.py
===================================================================
--- branches/testing_cleanup/scipy/stats/tests/test_morestats.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/tests/test_morestats.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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 TestBinomTest(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: branches/testing_cleanup/scipy/stats/tests/test_stats.py
===================================================================
--- branches/testing_cleanup/scipy/stats/tests/test_stats.py	2008-01-02 05:41:05 UTC (rev 3763)
+++ branches/testing_cleanup/scipy/stats/tests/test_stats.py	2008-01-02 07:54:58 UTC (rev 3764)
@@ -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()



More information about the Scipy-svn mailing list