[Scipy-svn] r6805 - in trunk/scipy: cluster/tests fftpack/tests linalg/tests ndimage/tests signal/tests spatial/tests stats/tests weave/tests

scipy-svn@scip... scipy-svn@scip...
Mon Sep 13 16:20:07 CDT 2010


Author: charris
Date: 2010-09-13 16:20:07 -0500 (Mon, 13 Sep 2010)
New Revision: 6805

Modified:
   trunk/scipy/cluster/tests/test_hierarchy.py
   trunk/scipy/fftpack/tests/test_basic.py
   trunk/scipy/fftpack/tests/test_real_transforms.py
   trunk/scipy/linalg/tests/test_build.py
   trunk/scipy/ndimage/tests/test_ndimage.py
   trunk/scipy/signal/tests/test_signaltools.py
   trunk/scipy/spatial/tests/test_distance.py
   trunk/scipy/stats/tests/test_distributions.py
   trunk/scipy/weave/tests/test_size_check.py
Log:
PY3: Replace deprecated testfunctions.

Modified: trunk/scipy/cluster/tests/test_hierarchy.py
===================================================================
--- trunk/scipy/cluster/tests/test_hierarchy.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/cluster/tests/test_hierarchy.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -107,7 +107,7 @@
     def test_linkage_empty_distance_matrix(self):
         "Tests linkage(Y) where Y is a 0x4 linkage matrix. Exception expected."
         y = np.zeros((0,))
-        self.failUnlessRaises(ValueError, linkage, y)
+        self.assertRaises(ValueError, linkage, y)
 
     ################### linkage
     def test_linkage_single_tdist(self):
@@ -116,7 +116,7 @@
         Zmlab = eo['linkage-single-tdist']
         eps = 1e-10
         expectedZ = from_mlab_linkage(Zmlab)
-        self.failUnless(within_tol(Z, expectedZ, eps))
+        self.assertTrue(within_tol(Z, expectedZ, eps))
 
     def test_linkage_complete_tdist(self):
         "Tests linkage(Y, 'complete') on the tdist data set."
@@ -124,7 +124,7 @@
         Zmlab = eo['linkage-complete-tdist']
         eps = 1e-10
         expectedZ = from_mlab_linkage(Zmlab)
-        self.failUnless(within_tol(Z, expectedZ, eps))
+        self.assertTrue(within_tol(Z, expectedZ, eps))
 
     def test_linkage_average_tdist(self):
         "Tests linkage(Y, 'average') on the tdist data set."
@@ -133,7 +133,7 @@
         eps = 1e-05
         expectedZ = from_mlab_linkage(Zmlab)
         #print Z, expectedZ, np.abs(Z - expectedZ).max()
-        self.failUnless(within_tol(Z, expectedZ, eps))
+        self.assertTrue(within_tol(Z, expectedZ, eps))
 
     def test_linkage_weighted_tdist(self):
         "Tests linkage(Y, 'weighted') on the tdist data set."
@@ -142,7 +142,7 @@
         eps = 1e-10
         expectedZ = from_mlab_linkage(Zmlab)
         #print Z, expectedZ, np.abs(Z - expectedZ).max()
-        self.failUnless(within_tol(Z, expectedZ, eps))
+        self.assertTrue(within_tol(Z, expectedZ, eps))
 
     ################### linkage on Q
     def test_linkage_single_q(self):
@@ -153,7 +153,7 @@
         eps = 1e-06
         expectedZ = from_mlab_linkage(Zmlab)
         #print abs(Z-expectedZ).max()
-        self.failUnless(within_tol(Z, expectedZ, eps))
+        self.assertTrue(within_tol(Z, expectedZ, eps))
 
     def test_linkage_complete_q(self):
         "Tests linkage(Y, 'complete') on the Q data set."
@@ -163,7 +163,7 @@
         eps = 1e-07
         expectedZ = from_mlab_linkage(Zmlab)
         #print abs(Z-expectedZ).max()
-        self.failUnless(within_tol(Z, expectedZ, eps))
+        self.assertTrue(within_tol(Z, expectedZ, eps))
 
     def test_linkage_centroid_q(self):
         "Tests linkage(Y, 'centroid') on the Q data set."
@@ -173,7 +173,7 @@
         eps = 1e-07
         expectedZ = from_mlab_linkage(Zmlab)
         #print abs(Z-expectedZ).max()
-        self.failUnless(within_tol(Z, expectedZ, eps))
+        self.assertTrue(within_tol(Z, expectedZ, eps))
 
     def test_linkage_weighted_q(self):
         "Tests linkage(Y, 'weighted') on the Q data set."
@@ -183,7 +183,7 @@
         eps = 1e-07
         expectedZ = from_mlab_linkage(Zmlab)
         #print abs(Z-expectedZ).max()
-        self.failUnless(within_tol(Z, expectedZ, eps))
+        self.assertTrue(within_tol(Z, expectedZ, eps))
 
 class TestInconsistent(TestCase):
 
@@ -195,7 +195,7 @@
         Rright = eo['inconsistent-single-tdist-depth-1']
         eps = 1e-15
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_single_inconsistent_tdist_2(self):
         "Tests inconsistency matrix calculation (depth=2) on a single linkage."
@@ -205,7 +205,7 @@
         Rright = eo['inconsistent-single-tdist-depth-2']
         eps = 1e-05
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_single_inconsistent_tdist_3(self):
         "Tests inconsistency matrix calculation (depth=3) on a single linkage."
@@ -215,7 +215,7 @@
         Rright = eo['inconsistent-single-tdist-depth-3']
         eps = 1e-05
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_single_inconsistent_tdist_4(self):
         "Tests inconsistency matrix calculation (depth=4) on a single linkage."
@@ -225,7 +225,7 @@
         Rright = eo['inconsistent-single-tdist-depth-4']
         eps = 1e-05
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     # with complete linkage...
 
@@ -237,7 +237,7 @@
         Rright = eo['inconsistent-complete-tdist-depth-1']
         eps = 1e-15
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_complete_inconsistent_tdist_2(self):
         "Tests inconsistency matrix calculation (depth=2) on a complete linkage."
@@ -247,7 +247,7 @@
         Rright = eo['inconsistent-complete-tdist-depth-2']
         eps = 1e-05
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_complete_inconsistent_tdist_3(self):
         "Tests inconsistency matrix calculation (depth=3) on a complete linkage."
@@ -257,7 +257,7 @@
         Rright = eo['inconsistent-complete-tdist-depth-3']
         eps = 1e-05
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_complete_inconsistent_tdist_4(self):
         "Tests inconsistency matrix calculation (depth=4) on a complete linkage."
@@ -267,7 +267,7 @@
         Rright = eo['inconsistent-complete-tdist-depth-4']
         eps = 1e-05
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     # with single linkage and Q data set
 
@@ -279,7 +279,7 @@
         Rright = eo['inconsistent-Q-single-1']
         eps = 1e-06
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_single_inconsistent_Q_2(self):
         "Tests inconsistency matrix calculation (depth=2, dataset=Q) with single linkage."
@@ -289,7 +289,7 @@
         Rright = eo['inconsistent-Q-single-2']
         eps = 1e-06
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_single_inconsistent_Q_3(self):
         "Tests inconsistency matrix calculation (depth=3, dataset=Q) with single linkage."
@@ -299,7 +299,7 @@
         Rright = eo['inconsistent-Q-single-3']
         eps = 1e-05
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
     def test_single_inconsistent_Q_4(self):
         "Tests inconsistency matrix calculation (depth=4, dataset=Q) with single linkage."
@@ -309,7 +309,7 @@
         Rright = eo['inconsistent-Q-single-4']
         eps = 1e-05
         #print np.abs(R - Rright).max()
-        self.failUnless(within_tol(R, Rright, eps))
+        self.assertTrue(within_tol(R, Rright, eps))
 
 class TestCopheneticDistance(TestCase):
 
@@ -319,7 +319,7 @@
         Z = linkage(_ytdist, 'single')
         M = cophenet(Z)
         eps = 1e-10
-        self.failUnless(within_tol(M, expectedM, eps))
+        self.assertTrue(within_tol(M, expectedM, eps))
 
     def test_linkage_cophenet_tdist_Z_Y(self):
         "Tests cophenet(Z, Y) on tdist data set."
@@ -328,8 +328,8 @@
         expectedM = np.array([268, 295, 255, 255, 295, 295, 268, 268, 295, 295, 295, 138, 219, 295, 295]);
         expectedc = 0.639931296433393415057366837573
         eps = 1e-10
-        self.failUnless(np.abs(c - expectedc) <= eps)
-        self.failUnless(within_tol(M, expectedM, eps))
+        self.assertTrue(np.abs(c - expectedc) <= eps)
+        self.assertTrue(within_tol(M, expectedM, eps))
 
 class TestFromMLabLinkage(TestCase):
 
@@ -337,14 +337,14 @@
         "Tests from_mlab_linkage on empty linkage array."
         X = np.asarray([])
         R = from_mlab_linkage([])
-        self.failUnless((R == X).all())
+        self.assertTrue((R == X).all())
 
     def test_from_mlab_linkage_single_row(self):
         "Tests from_mlab_linkage on linkage array with single row."
         expectedZP = np.asarray([[ 0.,  1.,  3.,  2.]])
         Z = [[1,2,3]]
         ZP = from_mlab_linkage(Z)
-        return self.failUnless((ZP == expectedZP).all())
+        return self.assertTrue((ZP == expectedZP).all())
 
     def test_from_mlab_linkage_multiple_rows(self):
         "Tests from_mlab_linkage on linkage array with multiple rows."
@@ -358,7 +358,7 @@
                               dtype=np.double)
         ZS = from_mlab_linkage(Z)
         #print expectedZS, ZS
-        self.failUnless((expectedZS == ZS).all())
+        self.assertTrue((expectedZS == ZS).all())
 
 
 class TestToMLabLinkage(TestCase):
@@ -367,14 +367,14 @@
         "Tests to_mlab_linkage on empty linkage array."
         X = np.asarray([])
         R = to_mlab_linkage([])
-        self.failUnless((R == X).all())
+        self.assertTrue((R == X).all())
 
     def test_to_mlab_linkage_single_row(self):
         "Tests to_mlab_linkage on linkage array with single row."
         Z = np.asarray([[ 0.,  1.,  3.,  2.]])
         expectedZP = np.asarray([[1,2,3]])
         ZP = to_mlab_linkage(Z)
-        return self.failUnless((ZP == expectedZP).all())
+        return self.assertTrue((ZP == expectedZP).all())
 
     def test_from_mlab_linkage_multiple_rows(self):
         "Tests to_mlab_linkage on linkage array with multiple rows."
@@ -388,7 +388,7 @@
                      dtype=np.double)
         ZM = to_mlab_linkage(Z)
         #print expectedZM, ZM
-        self.failUnless((expectedZM == ZM).all())
+        self.assertTrue((expectedZM == ZM).all())
 
 class TestFcluster(TestCase):
 
@@ -397,21 +397,21 @@
         expectedT = np.int_(eo['fclusterdata-maxclusts-2'])
         X = eo['Q-X']
         T = fclusterdata(X, criterion='maxclust', t=2)
-        self.failUnless(is_isomorphic(T, expectedT))
+        self.assertTrue(is_isomorphic(T, expectedT))
 
     def test_fclusterdata_maxclusts_3(self):
         "Tests fclusterdata(X, criterion='maxclust', t=3) on a random 3-cluster data set."
         expectedT = np.int_(eo['fclusterdata-maxclusts-3'])
         X = eo['Q-X']
         T = fclusterdata(X, criterion='maxclust', t=3)
-        self.failUnless(is_isomorphic(T, expectedT))
+        self.assertTrue(is_isomorphic(T, expectedT))
 
     def test_fclusterdata_maxclusts_4(self):
         "Tests fclusterdata(X, criterion='maxclust', t=4) on a random 3-cluster data set."
         expectedT = np.int_(eo['fclusterdata-maxclusts-4'])
         X = eo['Q-X']
         T = fclusterdata(X, criterion='maxclust', t=4)
-        self.failUnless(is_isomorphic(T, expectedT))
+        self.assertTrue(is_isomorphic(T, expectedT))
 
     def test_fcluster_maxclusts_2(self):
         "Tests fcluster(Z, criterion='maxclust', t=2) on a random 3-cluster data set."
@@ -420,7 +420,7 @@
         Y = pdist(X)
         Z = linkage(Y)
         T = fcluster(Z, criterion='maxclust', t=2)
-        self.failUnless(is_isomorphic(T, expectedT))
+        self.assertTrue(is_isomorphic(T, expectedT))
 
     def test_fcluster_maxclusts_3(self):
         "Tests fcluster(Z, criterion='maxclust', t=3) on a random 3-cluster data set."
@@ -429,7 +429,7 @@
         Y = pdist(X)
         Z = linkage(Y)
         T = fcluster(Z, criterion='maxclust', t=3)
-        self.failUnless(is_isomorphic(T, expectedT))
+        self.assertTrue(is_isomorphic(T, expectedT))
 
     def test_fcluster_maxclusts_4(self):
         "Tests fcluster(Z, criterion='maxclust', t=4) on a random 3-cluster data set."
@@ -438,7 +438,7 @@
         Y = pdist(X)
         Z = linkage(Y)
         T = fcluster(Z, criterion='maxclust', t=4)
-        self.failUnless(is_isomorphic(T, expectedT))
+        self.assertTrue(is_isomorphic(T, expectedT))
 
 class TestLeaders(TestCase):
 
@@ -451,7 +451,7 @@
         Lright = (np.array([53, 55, 56]), np.array([2, 3, 1]))
         L = leaders(Z, T)
         #print L, Lright, T
-        self.failUnless((L[0] == Lright[0]).all() and (L[1] == Lright[1]).all())
+        self.assertTrue((L[0] == Lright[0]).all() and (L[1] == Lright[1]).all())
 
 class TestIsIsomorphic(TestCase):
 
@@ -459,42 +459,42 @@
         "Tests is_isomorphic on test case #1 (one flat cluster, different labellings)"
         a = [1, 1, 1]
         b = [2, 2, 2]
-        self.failUnless(is_isomorphic(a, b) == True)
-        self.failUnless(is_isomorphic(b, a) == True)
+        self.assertTrue(is_isomorphic(a, b) == True)
+        self.assertTrue(is_isomorphic(b, a) == True)
 
     def test_is_isomorphic_2(self):
         "Tests is_isomorphic on test case #2 (two flat clusters, different labelings)"
         a = [1, 7, 1]
         b = [2, 3, 2]
-        self.failUnless(is_isomorphic(a, b) == True)
-        self.failUnless(is_isomorphic(b, a) == True)
+        self.assertTrue(is_isomorphic(a, b) == True)
+        self.assertTrue(is_isomorphic(b, a) == True)
 
     def test_is_isomorphic_3(self):
         "Tests is_isomorphic on test case #3 (no flat clusters)"
         a = []
         b = []
-        self.failUnless(is_isomorphic(a, b) == True)
+        self.assertTrue(is_isomorphic(a, b) == True)
 
     def test_is_isomorphic_4A(self):
         "Tests is_isomorphic on test case #4A (3 flat clusters, different labelings, isomorphic)"
         a = [1, 2, 3]
         b = [1, 3, 2]
-        self.failUnless(is_isomorphic(a, b) == True)
-        self.failUnless(is_isomorphic(b, a) == True)
+        self.assertTrue(is_isomorphic(a, b) == True)
+        self.assertTrue(is_isomorphic(b, a) == True)
 
     def test_is_isomorphic_4B(self):
         "Tests is_isomorphic on test case #4B (3 flat clusters, different labelings, nonisomorphic)"
         a = [1, 2, 3, 3]
         b = [1, 3, 2, 3]
-        self.failUnless(is_isomorphic(a, b) == False)
-        self.failUnless(is_isomorphic(b, a) == False)
+        self.assertTrue(is_isomorphic(a, b) == False)
+        self.assertTrue(is_isomorphic(b, a) == False)
 
     def test_is_isomorphic_4C(self):
         "Tests is_isomorphic on test case #4C (3 flat clusters, different labelings, isomorphic)"
         a = [7, 2, 3]
         b = [6, 3, 2]
-        self.failUnless(is_isomorphic(a, b) == True)
-        self.failUnless(is_isomorphic(b, a) == True)
+        self.assertTrue(is_isomorphic(a, b) == True)
+        self.assertTrue(is_isomorphic(b, a) == True)
 
     def test_is_isomorphic_5A(self):
         "Tests is_isomorphic on test case #5A (1000 observations, 2 random clusters, random permutation of the labeling). Run 3 times."
@@ -537,8 +537,8 @@
             Q = np.random.permutation(nobs)
             b[Q[0:nerrors]] += 1
             b[Q[0:nerrors]] %= nclusters
-        self.failUnless(is_isomorphic(a, b) == (not noniso))
-        self.failUnless(is_isomorphic(b, a) == (not noniso))
+        self.assertTrue(is_isomorphic(a, b) == (not noniso))
+        self.assertTrue(is_isomorphic(b, a) == (not noniso))
 
 class TestIsValidLinkage(TestCase):
 
@@ -546,46 +546,46 @@
         "Tests is_valid_linkage(Z) with integer type."
         Z = np.asarray([[0,   1, 3.0, 2],
                         [3,   2, 4.0, 3]], dtype=np.int)
-        self.failUnless(is_valid_linkage(Z) == False)
-        self.failUnlessRaises(TypeError, is_valid_linkage, Z, throw=True)
+        self.assertTrue(is_valid_linkage(Z) == False)
+        self.assertRaises(TypeError, is_valid_linkage, Z, throw=True)
 
     def test_is_valid_linkage_5_columns(self):
         "Tests is_valid_linkage(Z) with 5 columns."
         Z = np.asarray([[0,   1, 3.0, 2, 5],
                         [3,   2, 4.0, 3, 3]], dtype=np.double)
-        self.failUnless(is_valid_linkage(Z) == False)
-        self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True)
+        self.assertTrue(is_valid_linkage(Z) == False)
+        self.assertRaises(ValueError, is_valid_linkage, Z, throw=True)
 
     def test_is_valid_linkage_3_columns(self):
         "Tests is_valid_linkage(Z) with 3 columns."
         Z = np.asarray([[0,   1, 3.0],
                         [3,   2, 4.0]], dtype=np.double)
-        self.failUnless(is_valid_linkage(Z) == False)
-        self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True)
+        self.assertTrue(is_valid_linkage(Z) == False)
+        self.assertRaises(ValueError, is_valid_linkage, Z, throw=True)
 
     def test_is_valid_linkage_empty(self):
         "Tests is_valid_linkage(Z) with empty linkage."
         Z = np.zeros((0, 4), dtype=np.double)
-        self.failUnless(is_valid_linkage(Z) == False)
-        self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True)
+        self.assertTrue(is_valid_linkage(Z) == False)
+        self.assertRaises(ValueError, is_valid_linkage, Z, throw=True)
 
     def test_is_valid_linkage_1x4(self):
         "Tests is_valid_linkage(Z) on linkage over 2 observations."
         Z = np.asarray([[0,   1, 3.0, 2]], dtype=np.double)
-        self.failUnless(is_valid_linkage(Z) == True)
+        self.assertTrue(is_valid_linkage(Z) == True)
 
     def test_is_valid_linkage_2x4(self):
         "Tests is_valid_linkage(Z) on linkage over 3 observations."
         Z = np.asarray([[0,   1, 3.0, 2],
                         [3,   2, 4.0, 3]], dtype=np.double)
-        self.failUnless(is_valid_linkage(Z) == True)
+        self.assertTrue(is_valid_linkage(Z) == True)
 
     def test_is_valid_linkage_4_and_up(self):
         "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3)."
         for i in xrange(4, 15, 3):
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
-            self.failUnless(is_valid_linkage(Z) == True)
+            self.assertTrue(is_valid_linkage(Z) == True)
 
     def test_is_valid_linkage_4_and_up_neg_index_left(self):
         "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3) with negative indices (left)."
@@ -593,8 +593,8 @@
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
             Z[int(i/2),0] = -2
-            self.failUnless(is_valid_linkage(Z) == False)
-            self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True)
+            self.assertTrue(is_valid_linkage(Z) == False)
+            self.assertRaises(ValueError, is_valid_linkage, Z, throw=True)
 
     def test_is_valid_linkage_4_and_up_neg_index_right(self):
         "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3) with negative indices (right)."
@@ -602,8 +602,8 @@
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
             Z[int(i/2),1] = -2
-            self.failUnless(is_valid_linkage(Z) == False)
-            self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True)
+            self.assertTrue(is_valid_linkage(Z) == False)
+            self.assertRaises(ValueError, is_valid_linkage, Z, throw=True)
 
     def test_is_valid_linkage_4_and_up_neg_dist(self):
         "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3) with negative distances."
@@ -611,8 +611,8 @@
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
             Z[int(i/2),2] = -0.5
-            self.failUnless(is_valid_linkage(Z) == False)
-            self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True)
+            self.assertTrue(is_valid_linkage(Z) == False)
+            self.assertRaises(ValueError, is_valid_linkage, Z, throw=True)
 
     def test_is_valid_linkage_4_and_up_neg_counts(self):
         "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3) with negative counts."
@@ -620,8 +620,8 @@
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
             Z[int(i/2),3] = -2
-            self.failUnless(is_valid_linkage(Z) == False)
-            self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True)
+            self.assertTrue(is_valid_linkage(Z) == False)
+            self.assertRaises(ValueError, is_valid_linkage, Z, throw=True)
 
 class TestIsValidInconsistent(TestCase):
 
@@ -629,39 +629,39 @@
         "Tests is_valid_im(R) with integer type."
         R = np.asarray([[0,   1, 3.0, 2],
                         [3,   2, 4.0, 3]], dtype=np.int)
-        self.failUnless(is_valid_im(R) == False)
-        self.failUnlessRaises(TypeError, is_valid_im, R, throw=True)
+        self.assertTrue(is_valid_im(R) == False)
+        self.assertRaises(TypeError, is_valid_im, R, throw=True)
 
     def test_is_valid_im_5_columns(self):
         "Tests is_valid_im(R) with 5 columns."
         R = np.asarray([[0,   1, 3.0, 2, 5],
                         [3,   2, 4.0, 3, 3]], dtype=np.double)
-        self.failUnless(is_valid_im(R) == False)
-        self.failUnlessRaises(ValueError, is_valid_im, R, throw=True)
+        self.assertTrue(is_valid_im(R) == False)
+        self.assertRaises(ValueError, is_valid_im, R, throw=True)
 
     def test_is_valid_im_3_columns(self):
         "Tests is_valid_im(R) with 3 columns."
         R = np.asarray([[0,   1, 3.0],
                         [3,   2, 4.0]], dtype=np.double)
-        self.failUnless(is_valid_im(R) == False)
-        self.failUnlessRaises(ValueError, is_valid_im, R, throw=True)
+        self.assertTrue(is_valid_im(R) == False)
+        self.assertRaises(ValueError, is_valid_im, R, throw=True)
 
     def test_is_valid_im_empty(self):
         "Tests is_valid_im(R) with empty inconsistency matrix."
         R = np.zeros((0, 4), dtype=np.double)
-        self.failUnless(is_valid_im(R) == False)
-        self.failUnlessRaises(ValueError, is_valid_im, R, throw=True)
+        self.assertTrue(is_valid_im(R) == False)
+        self.assertRaises(ValueError, is_valid_im, R, throw=True)
 
     def test_is_valid_im_1x4(self):
         "Tests is_valid_im(R) on im over 2 observations."
         R = np.asarray([[0,   1, 3.0, 2]], dtype=np.double)
-        self.failUnless(is_valid_im(R) == True)
+        self.assertTrue(is_valid_im(R) == True)
 
     def test_is_valid_im_2x4(self):
         "Tests is_valid_im(R) on im over 3 observations."
         R = np.asarray([[0,   1, 3.0, 2],
                         [3,   2, 4.0, 3]], dtype=np.double)
-        self.failUnless(is_valid_im(R) == True)
+        self.assertTrue(is_valid_im(R) == True)
 
     def test_is_valid_im_4_and_up(self):
         "Tests is_valid_im(R) on im on observation sets between sizes 4 and 15 (step size 3)."
@@ -669,7 +669,7 @@
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
             R = inconsistent(Z)
-            self.failUnless(is_valid_im(R) == True)
+            self.assertTrue(is_valid_im(R) == True)
 
     def test_is_valid_im_4_and_up_neg_index_left(self):
         "Tests is_valid_im(R) on im on observation sets between sizes 4 and 15 (step size 3) with negative link height means."
@@ -678,8 +678,8 @@
             Z = linkage(y)
             R = inconsistent(Z)
             R[int(i/2),0] = -2.0
-            self.failUnless(is_valid_im(R) == False)
-            self.failUnlessRaises(ValueError, is_valid_im, R, throw=True)
+            self.assertTrue(is_valid_im(R) == False)
+            self.assertRaises(ValueError, is_valid_im, R, throw=True)
 
     def test_is_valid_im_4_and_up_neg_index_right(self):
         "Tests is_valid_im(R) on im on observation sets between sizes 4 and 15 (step size 3) with negative link height standard deviations."
@@ -688,8 +688,8 @@
             Z = linkage(y)
             R = inconsistent(Z)
             R[int(i/2),1] = -2.0
-            self.failUnless(is_valid_im(R) == False)
-            self.failUnlessRaises(ValueError, is_valid_im, R, throw=True)
+            self.assertTrue(is_valid_im(R) == False)
+            self.assertRaises(ValueError, is_valid_im, R, throw=True)
 
     def test_is_valid_im_4_and_up_neg_dist(self):
         "Tests is_valid_im(R) on im on observation sets between sizes 4 and 15 (step size 3) with negative link counts."
@@ -698,33 +698,33 @@
             Z = linkage(y)
             R = inconsistent(Z)
             R[int(i/2),2] = -0.5
-            self.failUnless(is_valid_im(R) == False)
-            self.failUnlessRaises(ValueError, is_valid_im, R, throw=True)
+            self.assertTrue(is_valid_im(R) == False)
+            self.assertRaises(ValueError, is_valid_im, R, throw=True)
 
 class TestNumObsLinkage(TestCase):
 
     def test_num_obs_linkage_empty(self):
         "Tests num_obs_linkage(Z) with empty linkage."
         Z = np.zeros((0, 4), dtype=np.double)
-        self.failUnlessRaises(ValueError, num_obs_linkage, Z)
+        self.assertRaises(ValueError, num_obs_linkage, Z)
 
     def test_num_obs_linkage_1x4(self):
         "Tests num_obs_linkage(Z) on linkage over 2 observations."
         Z = np.asarray([[0,   1, 3.0, 2]], dtype=np.double)
-        self.failUnless(num_obs_linkage(Z) == 2)
+        self.assertTrue(num_obs_linkage(Z) == 2)
 
     def test_num_obs_linkage_2x4(self):
         "Tests num_obs_linkage(Z) on linkage over 3 observations."
         Z = np.asarray([[0,   1, 3.0, 2],
                         [3,   2, 4.0, 3]], dtype=np.double)
-        self.failUnless(num_obs_linkage(Z) == 3)
+        self.assertTrue(num_obs_linkage(Z) == 3)
 
     def test_num_obs_linkage_4_and_up(self):
         "Tests num_obs_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3)."
         for i in xrange(4, 15, 3):
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
-            self.failUnless(num_obs_linkage(Z) == i)
+            self.assertTrue(num_obs_linkage(Z) == i)
 
 class TestLeavesList(TestCase):
 
@@ -732,14 +732,14 @@
         "Tests leaves_list(Z) on a 1x4 linkage."
         Z = np.asarray([[0,   1, 3.0, 2]], dtype=np.double)
         node = to_tree(Z)
-        self.failUnless((leaves_list(Z) == [0, 1]).all())
+        self.assertTrue((leaves_list(Z) == [0, 1]).all())
 
     def test_leaves_list_2x4(self):
         "Tests leaves_list(Z) on a 2x4 linkage."
         Z = np.asarray([[0,   1, 3.0, 2],
                         [3,   2, 4.0, 3]], dtype=np.double)
         node = to_tree(Z)
-        self.failUnless((leaves_list(Z) == [0, 1, 2]).all())
+        self.assertTrue((leaves_list(Z) == [0, 1, 2]).all())
 
     def test_leaves_list_iris_single(self):
         "Tests leaves_list(Z) on the Iris data set using single linkage."
@@ -747,7 +747,7 @@
         Y = pdist(X)
         Z = linkage(X, 'single')
         node = to_tree(Z)
-        self.failUnless((node.pre_order() == leaves_list(Z)).all())
+        self.assertTrue((node.pre_order() == leaves_list(Z)).all())
 
     def test_leaves_list_iris_complete(self):
         "Tests leaves_list(Z) on the Iris data set using complete linkage."
@@ -755,7 +755,7 @@
         Y = pdist(X)
         Z = linkage(X, 'complete')
         node = to_tree(Z)
-        self.failUnless((node.pre_order() == leaves_list(Z)).all())
+        self.assertTrue((node.pre_order() == leaves_list(Z)).all())
 
     def test_leaves_list_iris_centroid(self):
         "Tests leaves_list(Z) on the Iris data set using centroid linkage."
@@ -763,7 +763,7 @@
         Y = pdist(X)
         Z = linkage(X, 'centroid')
         node = to_tree(Z)
-        self.failUnless((node.pre_order() == leaves_list(Z)).all())
+        self.assertTrue((node.pre_order() == leaves_list(Z)).all())
 
     def test_leaves_list_iris_median(self):
         "Tests leaves_list(Z) on the Iris data set using median linkage."
@@ -771,7 +771,7 @@
         Y = pdist(X)
         Z = linkage(X, 'median')
         node = to_tree(Z)
-        self.failUnless((node.pre_order() == leaves_list(Z)).all())
+        self.assertTrue((node.pre_order() == leaves_list(Z)).all())
 
     def test_leaves_list_iris_ward(self):
         "Tests leaves_list(Z) on the Iris data set using ward linkage."
@@ -779,7 +779,7 @@
         Y = pdist(X)
         Z = linkage(X, 'ward')
         node = to_tree(Z)
-        self.failUnless((node.pre_order() == leaves_list(Z)).all())
+        self.assertTrue((node.pre_order() == leaves_list(Z)).all())
 
     def test_leaves_list_iris_average(self):
         "Tests leaves_list(Z) on the Iris data set using average linkage."
@@ -787,7 +787,7 @@
         Y = pdist(X)
         Z = linkage(X, 'average')
         node = to_tree(Z)
-        self.failUnless((node.pre_order() == leaves_list(Z)).all())
+        self.assertTrue((node.pre_order() == leaves_list(Z)).all())
 
 class TestCorrespond(TestCase):
 
@@ -795,18 +795,18 @@
         "Tests correspond(Z, y) with empty linkage and condensed distance matrix."
         y = np.zeros((0,))
         Z = np.zeros((0,4))
-        self.failUnlessRaises(ValueError, correspond, Z, y)
+        self.assertRaises(ValueError, correspond, Z, y)
 
     def test_correspond_2_and_up(self):
         "Tests correspond(Z, y) on linkage and CDMs over observation sets of different sizes."
         for i in xrange(2, 4):
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
-            self.failUnless(correspond(Z, y))
+            self.assertTrue(correspond(Z, y))
         for i in xrange(4, 15, 3):
             y = np.random.rand(i*(i-1)/2)
             Z = linkage(y)
-            self.failUnless(correspond(Z, y))
+            self.assertTrue(correspond(Z, y))
 
     def test_correspond_4_and_up(self):
         "Tests correspond(Z, y) on linkage and CDMs over observation sets of different sizes. Correspondance should be false."
@@ -815,8 +815,8 @@
             y2 = np.random.rand(j*(j-1)/2)
             Z = linkage(y)
             Z2 = linkage(y2)
-            self.failUnless(correspond(Z, y2) == False)
-            self.failUnless(correspond(Z2, y) == False)
+            self.assertTrue(correspond(Z, y2) == False)
+            self.assertTrue(correspond(Z2, y) == False)
 
     def test_correspond_4_and_up_2(self):
         "Tests correspond(Z, y) on linkage and CDMs over observation sets of different sizes. Correspondance should be false."
@@ -825,8 +825,8 @@
             y2 = np.random.rand(j*(j-1)/2)
             Z = linkage(y)
             Z2 = linkage(y2)
-            self.failUnless(correspond(Z, y2) == False)
-            self.failUnless(correspond(Z2, y) == False)
+            self.assertTrue(correspond(Z, y2) == False)
+            self.assertTrue(correspond(Z2, y) == False)
 
     def test_num_obs_linkage_multi_matrix(self):
         "Tests num_obs_linkage with observation matrices of multiple sizes."
@@ -836,84 +836,84 @@
             Z = linkage(Y)
             #print Z
             #print A.shape, Y.shape, Yr.shape
-            self.failUnless(num_obs_linkage(Z) == n)
+            self.assertTrue(num_obs_linkage(Z) == n)
 
 class TestIsMonotonic(TestCase):
 
     def test_is_monotonic_empty(self):
         "Tests is_monotonic(Z) on an empty linkage."
         Z = np.zeros((0, 4))
-        self.failUnlessRaises(ValueError, is_monotonic, Z)
+        self.assertRaises(ValueError, is_monotonic, Z)
 
     def test_is_monotonic_1x4(self):
         "Tests is_monotonic(Z) on 1x4 linkage. Expecting True."
         Z = np.asarray([[0, 1, 0.3, 2]], dtype=np.double);
-        self.failUnless(is_monotonic(Z) == True)
+        self.assertTrue(is_monotonic(Z) == True)
 
     def test_is_monotonic_2x4_T(self):
         "Tests is_monotonic(Z) on 2x4 linkage. Expecting True."
         Z = np.asarray([[0, 1, 0.3, 2],
                         [2, 3, 0.4, 3]], dtype=np.double)
-        self.failUnless(is_monotonic(Z) == True)
+        self.assertTrue(is_monotonic(Z) == True)
 
     def test_is_monotonic_2x4_F(self):
         "Tests is_monotonic(Z) on 2x4 linkage. Expecting False."
         Z = np.asarray([[0, 1, 0.4, 2],
                         [2, 3, 0.3, 3]], dtype=np.double)
-        self.failUnless(is_monotonic(Z) == False)
+        self.assertTrue(is_monotonic(Z) == False)
 
     def test_is_monotonic_3x4_T(self):
         "Tests is_monotonic(Z) on 3x4 linkage. Expecting True."
         Z = np.asarray([[0, 1, 0.3, 2],
                         [2, 3, 0.4, 2],
                         [4, 5, 0.6, 4]], dtype=np.double)
-        self.failUnless(is_monotonic(Z) == True)
+        self.assertTrue(is_monotonic(Z) == True)
 
     def test_is_monotonic_3x4_F1(self):
         "Tests is_monotonic(Z) on 3x4 linkage (case 1). Expecting False."
         Z = np.asarray([[0, 1, 0.3, 2],
                         [2, 3, 0.2, 2],
                         [4, 5, 0.6, 4]], dtype=np.double)
-        self.failUnless(is_monotonic(Z) == False)
+        self.assertTrue(is_monotonic(Z) == False)
 
     def test_is_monotonic_3x4_F2(self):
         "Tests is_monotonic(Z) on 3x4 linkage (case 2). Expecting False."
         Z = np.asarray([[0, 1, 0.8, 2],
                         [2, 3, 0.4, 2],
                         [4, 5, 0.6, 4]], dtype=np.double)
-        self.failUnless(is_monotonic(Z) == False)
+        self.assertTrue(is_monotonic(Z) == False)
 
     def test_is_monotonic_3x4_F3(self):
         "Tests is_monotonic(Z) on 3x4 linkage (case 3). Expecting False"
         Z = np.asarray([[0, 1, 0.3, 2],
                         [2, 3, 0.4, 2],
                         [4, 5, 0.2, 4]], dtype=np.double)
-        self.failUnless(is_monotonic(Z) == False)
+        self.assertTrue(is_monotonic(Z) == False)
 
     def test_is_monotonic_tdist_linkage(self):
         "Tests is_monotonic(Z) on clustering generated by single linkage on tdist data set. Expecting True."
         Z = linkage(_ytdist, 'single')
-        self.failUnless(is_monotonic(Z) == True)
+        self.assertTrue(is_monotonic(Z) == True)
 
     def test_is_monotonic_tdist_linkage(self):
         "Tests is_monotonic(Z) on clustering generated by single linkage on tdist data set. Perturbing. Expecting False."
         Z = linkage(_ytdist, 'single')
         Z[2,2]=0.0
-        self.failUnless(is_monotonic(Z) == False)
+        self.assertTrue(is_monotonic(Z) == False)
 
     def test_is_monotonic_iris_linkage(self):
         "Tests is_monotonic(Z) on clustering generated by single linkage on Iris data set. Expecting True."
         X = eo['iris']
         Y = pdist(X)
         Z = linkage(X, 'single')
-        self.failUnless(is_monotonic(Z) == True)
+        self.assertTrue(is_monotonic(Z) == True)
 
 class TestMaxDists(TestCase):
 
     def test_maxdists_empty_linkage(self):
         "Tests maxdists(Z) on empty linkage. Expecting exception."
         Z = np.zeros((0, 4), dtype=np.double)
-        self.failUnlessRaises(ValueError, maxdists, Z)
+        self.assertRaises(ValueError, maxdists, Z)
 
     def test_maxdists_one_cluster_linkage(self):
         "Tests maxdists(Z) on linkage with one cluster."
@@ -921,7 +921,7 @@
         MD = maxdists(Z)
         eps = 1e-15
         expectedMD = calculate_maximum_distances(Z)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxdists_Q_linkage_single(self):
         "Tests maxdists(Z) on the Q data set using single linkage."
@@ -931,7 +931,7 @@
         MD = maxdists(Z)
         eps = 1e-15
         expectedMD = calculate_maximum_distances(Z)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxdists_Q_linkage_complete(self):
         "Tests maxdists(Z) on the Q data set using complete linkage."
@@ -941,7 +941,7 @@
         MD = maxdists(Z)
         eps = 1e-15
         expectedMD = calculate_maximum_distances(Z)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxdists_Q_linkage_ward(self):
         "Tests maxdists(Z) on the Q data set using Ward linkage."
@@ -951,7 +951,7 @@
         MD = maxdists(Z)
         eps = 1e-15
         expectedMD = calculate_maximum_distances(Z)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxdists_Q_linkage_centroid(self):
         "Tests maxdists(Z) on the Q data set using centroid linkage."
@@ -961,7 +961,7 @@
         MD = maxdists(Z)
         eps = 1e-15
         expectedMD = calculate_maximum_distances(Z)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxdists_Q_linkage_median(self):
         "Tests maxdists(Z) on the Q data set using median linkage."
@@ -971,7 +971,7 @@
         MD = maxdists(Z)
         eps = 1e-15
         expectedMD = calculate_maximum_distances(Z)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
 class TestMaxInconsts(TestCase):
 
@@ -979,13 +979,13 @@
         "Tests maxinconsts(Z, R) on empty linkage. Expecting exception."
         Z = np.zeros((0, 4), dtype=np.double)
         R = np.zeros((0, 4), dtype=np.double)
-        self.failUnlessRaises(ValueError, maxinconsts, Z, R)
+        self.assertRaises(ValueError, maxinconsts, Z, R)
 
     def test_maxinconsts_difrow_linkage(self):
         "Tests maxinconsts(Z, R) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception."
         Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double)
         R = np.random.rand(2, 4)
-        self.failUnlessRaises(ValueError, maxinconsts, Z, R)
+        self.assertRaises(ValueError, maxinconsts, Z, R)
 
     def test_maxinconsts_one_cluster_linkage(self):
         "Tests maxinconsts(Z, R) on linkage with one cluster."
@@ -994,7 +994,7 @@
         MD = maxinconsts(Z, R)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxinconsts_Q_linkage_single(self):
         "Tests maxinconsts(Z, R) on the Q data set using single linkage."
@@ -1005,7 +1005,7 @@
         MD = maxinconsts(Z, R)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxinconsts_Q_linkage_complete(self):
         "Tests maxinconsts(Z, R) on the Q data set using complete linkage."
@@ -1016,7 +1016,7 @@
         MD = maxinconsts(Z, R)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxinconsts_Q_linkage_ward(self):
         "Tests maxinconsts(Z, R) on the Q data set using Ward linkage."
@@ -1027,7 +1027,7 @@
         MD = maxinconsts(Z, R)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxinconsts_Q_linkage_centroid(self):
         "Tests maxinconsts(Z, R) on the Q data set using centroid linkage."
@@ -1038,7 +1038,7 @@
         MD = maxinconsts(Z, R)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxinconsts_Q_linkage_median(self):
         "Tests maxinconsts(Z, R) on the Q data set using median linkage."
@@ -1049,7 +1049,7 @@
         MD = maxinconsts(Z, R)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
 class TestMaxRStat(TestCase):
 
@@ -1057,31 +1057,31 @@
         "Tests maxRstat(Z, R, 3.3). Expecting exception."
         Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double)
         R = np.asarray([[0, 0, 0, 0.3]], dtype=np.double)
-        self.failUnlessRaises(TypeError, maxRstat, Z, R, 3.3)
+        self.assertRaises(TypeError, maxRstat, Z, R, 3.3)
 
     def test_maxRstat_neg_index(self):
         "Tests maxRstat(Z, R, -1). Expecting exception."
         Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double)
         R = np.asarray([[0, 0, 0, 0.3]], dtype=np.double)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, -1)
+        self.assertRaises(ValueError, maxRstat, Z, R, -1)
 
     def test_maxRstat_oob_pos_index(self):
         "Tests maxRstat(Z, R, 4). Expecting exception."
         Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double)
         R = np.asarray([[0, 0, 0, 0.3]], dtype=np.double)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 4)
+        self.assertRaises(ValueError, maxRstat, Z, R, 4)
 
     def test_maxRstat_0_empty_linkage(self):
         "Tests maxRstat(Z, R, 0) on empty linkage. Expecting exception."
         Z = np.zeros((0, 4), dtype=np.double)
         R = np.zeros((0, 4), dtype=np.double)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 0)
+        self.assertRaises(ValueError, maxRstat, Z, R, 0)
 
     def test_maxRstat_0_difrow_linkage(self):
         "Tests maxRstat(Z, R, 0) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception."
         Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double)
         R = np.random.rand(2, 4)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 0)
+        self.assertRaises(ValueError, maxRstat, Z, R, 0)
 
     def test_maxRstat_0_one_cluster_linkage(self):
         "Tests maxRstat(Z, R, 0) on linkage with one cluster."
@@ -1090,7 +1090,7 @@
         MD = maxRstat(Z, R, 0)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 0)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_0_Q_linkage_single(self):
         "Tests maxRstat(Z, R, 0) on the Q data set using single linkage."
@@ -1101,7 +1101,7 @@
         MD = maxRstat(Z, R, 0)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 0)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_0_Q_linkage_complete(self):
         "Tests maxRstat(Z, R, 0) on the Q data set using complete linkage."
@@ -1112,7 +1112,7 @@
         MD = maxRstat(Z, R, 0)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 0)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_0_Q_linkage_ward(self):
         "Tests maxRstat(Z, R, 0) on the Q data set using Ward linkage."
@@ -1123,7 +1123,7 @@
         MD = maxRstat(Z, R, 0)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 0)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_0_Q_linkage_centroid(self):
         "Tests maxRstat(Z, R, 0) on the Q data set using centroid linkage."
@@ -1134,7 +1134,7 @@
         MD = maxRstat(Z, R, 0)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 0)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_0_Q_linkage_median(self):
         "Tests maxRstat(Z, R, 0) on the Q data set using median linkage."
@@ -1145,19 +1145,19 @@
         MD = maxRstat(Z, R, 0)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 0)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_1_empty_linkage(self):
         "Tests maxRstat(Z, R, 1) on empty linkage. Expecting exception."
         Z = np.zeros((0, 4), dtype=np.double)
         R = np.zeros((0, 4), dtype=np.double)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 0)
+        self.assertRaises(ValueError, maxRstat, Z, R, 0)
 
     def test_maxRstat_1_difrow_linkage(self):
         "Tests maxRstat(Z, R, 1) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception."
         Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double)
         R = np.random.rand(2, 4)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 0)
+        self.assertRaises(ValueError, maxRstat, Z, R, 0)
 
     def test_maxRstat_1_one_cluster_linkage(self):
         "Tests maxRstat(Z, R, 1) on linkage with one cluster."
@@ -1166,7 +1166,7 @@
         MD = maxRstat(Z, R, 1)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 1)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_1_Q_linkage_single(self):
         "Tests maxRstat(Z, R, 1) on the Q data set using single linkage."
@@ -1177,7 +1177,7 @@
         MD = maxRstat(Z, R, 1)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 1)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_1_Q_linkage_complete(self):
         "Tests maxRstat(Z, R, 1) on the Q data set using complete linkage."
@@ -1188,7 +1188,7 @@
         MD = maxRstat(Z, R, 1)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 1)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_1_Q_linkage_ward(self):
         "Tests maxRstat(Z, R, 1) on the Q data set using Ward linkage."
@@ -1199,7 +1199,7 @@
         MD = maxRstat(Z, R, 1)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 1)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_1_Q_linkage_centroid(self):
         "Tests maxRstat(Z, R, 1) on the Q data set using centroid linkage."
@@ -1210,7 +1210,7 @@
         MD = maxRstat(Z, R, 1)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 1)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_1_Q_linkage_median(self):
         "Tests maxRstat(Z, R, 1) on the Q data set using median linkage."
@@ -1221,19 +1221,19 @@
         MD = maxRstat(Z, R, 1)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 1)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_2_empty_linkage(self):
         "Tests maxRstat(Z, R, 2) on empty linkage. Expecting exception."
         Z = np.zeros((0, 4), dtype=np.double)
         R = np.zeros((0, 4), dtype=np.double)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 2)
+        self.assertRaises(ValueError, maxRstat, Z, R, 2)
 
     def test_maxRstat_2_difrow_linkage(self):
         "Tests maxRstat(Z, R, 2) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception."
         Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double)
         R = np.random.rand(2, 4)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 2)
+        self.assertRaises(ValueError, maxRstat, Z, R, 2)
 
     def test_maxRstat_2_one_cluster_linkage(self):
         "Tests maxRstat(Z, R, 2) on linkage with one cluster."
@@ -1242,7 +1242,7 @@
         MD = maxRstat(Z, R, 2)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 2)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_2_Q_linkage_single(self):
         "Tests maxRstat(Z, R, 2) on the Q data set using single linkage."
@@ -1253,7 +1253,7 @@
         MD = maxRstat(Z, R, 2)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 2)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_2_Q_linkage_complete(self):
         "Tests maxRstat(Z, R, 2) on the Q data set using complete linkage."
@@ -1264,7 +1264,7 @@
         MD = maxRstat(Z, R, 2)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 2)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_2_Q_linkage_ward(self):
         "Tests maxRstat(Z, R, 2) on the Q data set using Ward linkage."
@@ -1275,7 +1275,7 @@
         MD = maxRstat(Z, R, 2)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 2)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_2_Q_linkage_centroid(self):
         "Tests maxRstat(Z, R, 2) on the Q data set using centroid linkage."
@@ -1286,7 +1286,7 @@
         MD = maxRstat(Z, R, 2)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 2)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_2_Q_linkage_median(self):
         "Tests maxRstat(Z, R, 2) on the Q data set using median linkage."
@@ -1297,19 +1297,19 @@
         MD = maxRstat(Z, R, 2)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 2)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_3_empty_linkage(self):
         "Tests maxRstat(Z, R, 3) on empty linkage. Expecting exception."
         Z = np.zeros((0, 4), dtype=np.double)
         R = np.zeros((0, 4), dtype=np.double)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 3)
+        self.assertRaises(ValueError, maxRstat, Z, R, 3)
 
     def test_maxRstat_3_difrow_linkage(self):
         "Tests maxRstat(Z, R, 3) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception."
         Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double)
         R = np.random.rand(2, 4)
-        self.failUnlessRaises(ValueError, maxRstat, Z, R, 3)
+        self.assertRaises(ValueError, maxRstat, Z, R, 3)
 
     def test_maxRstat_3_one_cluster_linkage(self):
         "Tests maxRstat(Z, R, 3) on linkage with one cluster."
@@ -1318,7 +1318,7 @@
         MD = maxRstat(Z, R, 3)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 3)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_3_Q_linkage_single(self):
         "Tests maxRstat(Z, R, 3) on the Q data set using single linkage."
@@ -1329,7 +1329,7 @@
         MD = maxRstat(Z, R, 3)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 3)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_3_Q_linkage_complete(self):
         "Tests maxRstat(Z, R, 3) on the Q data set using complete linkage."
@@ -1340,7 +1340,7 @@
         MD = maxRstat(Z, R, 3)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 3)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_3_Q_linkage_ward(self):
         "Tests maxRstat(Z, R, 3) on the Q data set using Ward linkage."
@@ -1351,7 +1351,7 @@
         MD = maxRstat(Z, R, 3)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 3)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_3_Q_linkage_centroid(self):
         "Tests maxRstat(Z, R, 3) on the Q data set using centroid linkage."
@@ -1362,7 +1362,7 @@
         MD = maxRstat(Z, R, 3)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 3)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
     def test_maxRstat_3_Q_linkage_median(self):
         "Tests maxRstat(Z, R, 3) on the Q data set using median linkage."
@@ -1373,7 +1373,7 @@
         MD = maxRstat(Z, R, 3)
         eps = 1e-15
         expectedMD = calculate_maximum_inconsistencies(Z, R, 3)
-        self.failUnless(within_tol(MD, expectedMD, eps))
+        self.assertTrue(within_tol(MD, expectedMD, eps))
 
 def calculate_maximum_distances(Z):
     "Used for testing correctness of maxdists. Very slow."

Modified: trunk/scipy/fftpack/tests/test_basic.py
===================================================================
--- trunk/scipy/fftpack/tests/test_basic.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/fftpack/tests/test_basic.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -99,7 +99,7 @@
     def test_definition(self):
         x = np.array([1,2,3,4+1j,1,2,3,4+2j], dtype = self.cdt)
         y = fft(x)
-        self.failUnless(y.dtype == self.cdt,
+        self.assertTrue(y.dtype == self.cdt,
                 "Output dtype is %s, expected %s" % (y.dtype, self.cdt))
         y1 = direct_dft(x)
         assert_array_almost_equal(y,y1)
@@ -110,7 +110,7 @@
         x1 = np.array([1,2,3,4], dtype=self.rdt)
         x2 = np.array([1,2,3,4], dtype=self.rdt)
         y = fft([x1,x2],n=4)
-        self.failUnless(y.dtype == self.cdt,
+        self.assertTrue(y.dtype == self.cdt,
                 "Output dtype is %s, expected %s" % (y.dtype, self.cdt))
         assert_equal(y.shape,(2,4))
         assert_array_almost_equal(y[0],direct_dft(x1))
@@ -120,7 +120,7 @@
         x1 = np.array([1,2,3,4+1j], dtype=self.cdt)
         x2 = np.array([1,2,3,4+1j], dtype=self.cdt)
         y = fft([x1,x2],n=4)
-        self.failUnless(y.dtype == self.cdt,
+        self.assertTrue(y.dtype == self.cdt,
                 "Output dtype is %s, expected %s" % (y.dtype, self.cdt))
         assert_equal(y.shape,(2,4))
         assert_array_almost_equal(y[0],direct_dft(x1))
@@ -155,7 +155,7 @@
         x = np.array([1,2,3,4+1j,1,2,3,4+2j], self.cdt)
         y = ifft(x)
         y1 = direct_idft(x)
-        self.failUnless(y.dtype == self.cdt,
+        self.assertTrue(y.dtype == self.cdt,
                 "Output dtype is %s, expected %s" % (y.dtype, self.cdt))
         assert_array_almost_equal(y,y1)
 
@@ -165,13 +165,13 @@
     def test_definition_real(self):
         x = np.array([1,2,3,4,1,2,3,4], self.rdt)
         y = ifft(x)
-        self.failUnless(y.dtype == self.cdt,
+        self.assertTrue(y.dtype == self.cdt,
                 "Output dtype is %s, expected %s" % (y.dtype, self.cdt))
         y1 = direct_idft(x)
         assert_array_almost_equal(y,y1)
 
         x = np.array([1,2,3,4,5], dtype=self.rdt)
-        self.failUnless(y.dtype == self.cdt,
+        self.assertTrue(y.dtype == self.cdt,
                 "Output dtype is %s, expected %s" % (y.dtype, self.cdt))
         assert_array_almost_equal(ifft(x),direct_idft(x))
 
@@ -191,9 +191,9 @@
             x = random([size]).astype(self.cdt) +1j*x
             y1 = ifft(fft(x))
             y2 = fft(ifft(x))
-            self.failUnless(y1.dtype == self.cdt,
+            self.assertTrue(y1.dtype == self.cdt,
                     "Output dtype is %s, expected %s" % (y1.dtype, self.cdt))
-            self.failUnless(y2.dtype == self.cdt,
+            self.assertTrue(y2.dtype == self.cdt,
                     "Output dtype is %s, expected %s" % (y2.dtype, self.cdt))
             assert_array_almost_equal (y1, x)
             assert_array_almost_equal (y2, x)
@@ -203,9 +203,9 @@
             x = random([size]).astype(self.rdt)
             y1 = ifft(fft(x))
             y2 = fft(ifft(x))
-            self.failUnless(y1.dtype == self.cdt,
+            self.assertTrue(y1.dtype == self.cdt,
                     "Output dtype is %s, expected %s" % (y1.dtype, self.cdt))
-            self.failUnless(y2.dtype == self.cdt,
+            self.assertTrue(y2.dtype == self.cdt,
                     "Output dtype is %s, expected %s" % (y2.dtype, self.cdt))
             assert_array_almost_equal (y1, x)
             assert_array_almost_equal (y2, x)
@@ -230,7 +230,7 @@
             y = rfft(x)
             y1 = direct_rdft(x)
             assert_array_almost_equal(y,y1)
-            self.failUnless(y.dtype == self.rdt,
+            self.assertTrue(y.dtype == self.rdt,
                     "Output dtype is %s, expected %s" % (y.dtype, self.rdt))
 
     def test_djbfft(self):
@@ -271,7 +271,7 @@
         def _test(x, xr):
             y = irfft(np.array(x, dtype=self.rdt))
             y1 = direct_irdft(x)
-            self.failUnless(y.dtype == self.rdt,
+            self.assertTrue(y.dtype == self.rdt,
                     "Output dtype is %s, expected %s" % (y.dtype, self.rdt))
             assert_array_almost_equal(y,y1, decimal=self.ndec)
             assert_array_almost_equal(y,ifft(xr), decimal=self.ndec)
@@ -299,9 +299,9 @@
             x = random([size]).astype(self.rdt)
             y1 = irfft(rfft(x))
             y2 = rfft(irfft(x))
-            self.failUnless(y1.dtype == self.rdt,
+            self.assertTrue(y1.dtype == self.rdt,
                     "Output dtype is %s, expected %s" % (y1.dtype, self.rdt))
-            self.failUnless(y2.dtype == self.rdt,
+            self.assertTrue(y2.dtype == self.rdt,
                     "Output dtype is %s, expected %s" % (y2.dtype, self.rdt))
             assert_array_almost_equal (y1, x, decimal=self.ndec)
             assert_array_almost_equal (y2, x, decimal=self.ndec)

Modified: trunk/scipy/fftpack/tests/test_real_transforms.py
===================================================================
--- trunk/scipy/fftpack/tests/test_real_transforms.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/fftpack/tests/test_real_transforms.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -42,7 +42,7 @@
         for i in FFTWDATA_SIZES:
             x, yr = fftw_ref(self.type, i, self.rdt)
             y = dct(x, type=self.type)
-            self.failUnless(y.dtype == self.rdt,
+            self.assertTrue(y.dtype == self.rdt,
                     "Output dtype is %s, expected %s" % (y.dtype, self.rdt))
             # XXX: we divide by np.max(y) because the tests fail otherwise. We
             # should really use something like assert_array_approx_equal. The
@@ -73,7 +73,7 @@
             x = np.array(X[i], dtype=self.rdt)
             yr = Y[i]
             y = dct(x, norm="ortho", type=2)
-            self.failUnless(y.dtype == self.rdt,
+            self.assertTrue(y.dtype == self.rdt,
                     "Output dtype is %s, expected %s" % (y.dtype, self.rdt))
             assert_array_almost_equal(y, yr, decimal=self.dec)
 
@@ -84,7 +84,7 @@
             x = np.array(X[i], dtype=self.rdt)
             y = dct(x, norm='ortho', type=2)
             xi = dct(y, norm="ortho", type=3)
-            self.failUnless(xi.dtype == self.rdt,
+            self.assertTrue(xi.dtype == self.rdt,
                     "Output dtype is %s, expected %s" % (xi.dtype, self.rdt))
             assert_array_almost_equal(xi, x, decimal=self.dec)
 
@@ -139,7 +139,7 @@
                 x /= 2 * (i-1)
             else:
                 x /= 2 * i
-            self.failUnless(x.dtype == self.rdt,
+            self.assertTrue(x.dtype == self.rdt,
                     "Output dtype is %s, expected %s" % (x.dtype, self.rdt))
             # XXX: we divide by np.max(y) because the tests fail otherwise. We
             # should really use something like assert_array_approx_equal. The

Modified: trunk/scipy/linalg/tests/test_build.py
===================================================================
--- trunk/scipy/linalg/tests/test_build.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/linalg/tests/test_build.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -45,7 +45,7 @@
         f = FindDependenciesLdd()
         deps = f.grep_dependencies(flapack.__file__,
                                    ['libg2c', 'libgfortran'])
-        self.failIf(len(deps) > 1,
+        self.assertFalse(len(deps) > 1,
 """Both g77 and gfortran runtimes linked in scipy.linalg.flapack ! This is
 likely to cause random crashes and wrong results. See numpy INSTALL.txt for
 more information.""")

Modified: trunk/scipy/ndimage/tests/test_ndimage.py
===================================================================
--- trunk/scipy/ndimage/tests/test_ndimage.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/ndimage/tests/test_ndimage.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -79,26 +79,26 @@
         weights = numpy.array([2])
         true = [2, 4]
         output = ndimage.correlate(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.convolve(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.correlate1d(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.convolve1d(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
 
     def test_correlate02(self):
         "correlation 2"
         array = numpy.array([1, 2, 3])
         kernel = numpy.array([1])
         output = ndimage.correlate(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.convolve(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.correlate1d(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.convolve1d(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
 
     def test_correlate03(self):
         "correlation 3"
@@ -106,13 +106,13 @@
         weights = numpy.array([1, 1])
         true = [2]
         output = ndimage.correlate(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.convolve(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.correlate1d(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.convolve1d(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
 
     def test_correlate04(self):
         "correlation 4"
@@ -121,13 +121,13 @@
         tcov = [3, 4]
         weights = numpy.array([1, 1])
         output = ndimage.correlate(array, weights)
-        self.failUnless(diff(output, tcor) < eps)
+        self.assertTrue(diff(output, tcor) < eps)
         output = ndimage.convolve(array, weights)
-        self.failUnless(diff(output, tcov) < eps)
+        self.assertTrue(diff(output, tcov) < eps)
         output = ndimage.correlate1d(array, weights)
-        self.failUnless(diff(output, tcor) < eps)
+        self.assertTrue(diff(output, tcor) < eps)
         output = ndimage.convolve1d(array, weights)
-        self.failUnless(diff(output, tcov) < eps)
+        self.assertTrue(diff(output, tcov) < eps)
 
     def test_correlate05(self):
         "correlation 5"
@@ -136,13 +136,13 @@
         tcov = [3, 5, 6]
         kernel = numpy.array([1, 1])
         output = ndimage.correlate(array, kernel)
-        self.failUnless(diff(tcor, output) < eps)
+        self.assertTrue(diff(tcor, output) < eps)
         output = ndimage.convolve(array, kernel)
-        self.failUnless(diff(tcov, output) < eps)
+        self.assertTrue(diff(tcov, output) < eps)
         output = ndimage.correlate1d(array, kernel)
-        self.failUnless(diff(tcor, output) < eps)
+        self.assertTrue(diff(tcor, output) < eps)
         output = ndimage.convolve1d(array, kernel)
-        self.failUnless(diff(tcov, output) < eps)
+        self.assertTrue(diff(tcov, output) < eps)
 
     def test_correlate06(self):
         "correlation 6"
@@ -151,13 +151,13 @@
         tcov = [7, 10, 15]
         weights = numpy.array([1, 2, 3])
         output = ndimage.correlate(array, weights)
-        self.failUnless(diff(output, tcor) < eps)
+        self.assertTrue(diff(output, tcor) < eps)
         output = ndimage.convolve(array, weights)
-        self.failUnless(diff(output, tcov) < eps)
+        self.assertTrue(diff(output, tcov) < eps)
         output = ndimage.correlate1d(array, weights)
-        self.failUnless(diff(output, tcor) < eps)
+        self.assertTrue(diff(output, tcor) < eps)
         output = ndimage.convolve1d(array, weights)
-        self.failUnless(diff(output, tcov) < eps)
+        self.assertTrue(diff(output, tcov) < eps)
 
     def test_correlate07(self):
         "correlation 7"
@@ -165,13 +165,13 @@
         true = [5, 8, 11]
         weights = numpy.array([1, 2, 1])
         output = ndimage.correlate(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.convolve(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.correlate1d(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.convolve1d(array, weights)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
 
     def test_correlate08(self):
         "correlation 8"
@@ -180,35 +180,35 @@
         tcov = [3, 6, 7]
         weights = numpy.array([1, 2, -1])
         output = ndimage.correlate(array, weights)
-        self.failUnless(diff(output, tcor) < eps)
+        self.assertTrue(diff(output, tcor) < eps)
         output = ndimage.convolve(array, weights)
-        self.failUnless(diff(output, tcov) < eps)
+        self.assertTrue(diff(output, tcov) < eps)
         output = ndimage.correlate1d(array, weights)
-        self.failUnless(diff(output, tcor) < eps)
+        self.assertTrue(diff(output, tcor) < eps)
         output = ndimage.convolve1d(array, weights)
-        self.failUnless(diff(output, tcov) < eps)
+        self.assertTrue(diff(output, tcov) < eps)
 
     def test_correlate09(self):
         "correlation 9"
         array = []
         kernel = numpy.array([1, 1])
         output = ndimage.correlate(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.convolve(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.correlate1d(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.convolve1d(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
 
     def test_correlate10(self):
         "correlation 10"
         array = [[]]
         kernel = numpy.array([[1, 1]])
         output = ndimage.correlate(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.convolve(array, kernel)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
 
     def test_correlate11(self):
         "correlation 11"
@@ -217,9 +217,9 @@
         kernel = numpy.array([[1, 1],
                                  [1, 1]])
         output = ndimage.correlate(array, kernel)
-        self.failUnless(diff([[4, 6, 10], [10, 12, 16]], output) < eps)
+        self.assertTrue(diff([[4, 6, 10], [10, 12, 16]], output) < eps)
         output = ndimage.convolve(array, kernel)
-        self.failUnless(diff([[12, 16, 18], [18, 22, 24]], output) < eps)
+        self.assertTrue(diff([[12, 16, 18], [18, 22, 24]], output) < eps)
 
     def test_correlate12(self):
         "correlation 12"
@@ -228,9 +228,9 @@
         kernel = numpy.array([[1, 0],
                                  [0, 1]])
         output = ndimage.correlate(array, kernel)
-        self.failUnless(diff([[2, 3, 5], [5, 6, 8]], output) < eps)
+        self.assertTrue(diff([[2, 3, 5], [5, 6, 8]], output) < eps)
         output = ndimage.convolve(array, kernel)
-        self.failUnless(diff([[6, 8, 9], [9, 11, 12]], output) < eps)
+        self.assertTrue(diff([[6, 8, 9], [9, 11, 12]], output) < eps)
 
     def test_correlate13(self):
         "correlation 13"
@@ -243,11 +243,11 @@
                 output = ndimage.correlate(array, kernel,
                                                     output = type2)
                 error = diff([[2, 3, 5], [5, 6, 8]], output)
-                self.failUnless(error < eps and output.dtype.type == type2)
+                self.assertTrue(error < eps and output.dtype.type == type2)
                 output = ndimage.convolve(array, kernel,
                                                    output = type2)
                 error = diff([[6, 8, 9], [9, 11, 12]], output)
-                self.failUnless(error < eps and output.dtype.type == type2)
+                self.assertTrue(error < eps and output.dtype.type == type2)
 
     def test_correlate14(self):
         "correlation 14"
@@ -261,10 +261,10 @@
                 ndimage.correlate(array, kernel,
                                                         output = output)
                 error = diff([[2, 3, 5], [5, 6, 8]], output)
-                self.failUnless(error < eps and output.dtype.type == type2)
+                self.assertTrue(error < eps and output.dtype.type == type2)
                 ndimage.convolve(array, kernel, output = output)
                 error = diff([[6, 8, 9], [9, 11, 12]], output)
-                self.failUnless(error < eps and output.dtype.type == type2)
+                self.assertTrue(error < eps and output.dtype.type == type2)
 
     def test_correlate15(self):
         "correlation 15"
@@ -276,12 +276,12 @@
             output = ndimage.correlate(array, kernel,
                                                 output = numpy.float32)
             error = diff([[2, 3, 5], [5, 6, 8]], output)
-            self.failUnless(error < eps and
+            self.assertTrue(error < eps and
                             output.dtype.type == numpy.float32)
             output = ndimage.convolve(array, kernel,
                                                output = numpy.float32)
             error = diff([[6, 8, 9], [9, 11, 12]], output)
-            self.failUnless(error < eps and
+            self.assertTrue(error < eps and
                             output.dtype.type == numpy.float32)
 
     def test_correlate16(self):
@@ -294,12 +294,12 @@
             output = ndimage.correlate(array, kernel,
                                                 output = numpy.float32)
             error = diff([[1, 1.5, 2.5], [2.5, 3, 4]], output)
-            self.failUnless(error < eps and
+            self.assertTrue(error < eps and
                             output.dtype.type == numpy.float32)
             output = ndimage.convolve(array, kernel,
                                                output = numpy.float32)
             error = diff([[3, 4, 4.5], [4.5, 5.5, 6]], output)
-            self.failUnless(error < eps and
+            self.assertTrue(error < eps and
                             output.dtype.type == numpy.float32)
 
     def test_correlate17(self):
@@ -309,13 +309,13 @@
         tcov = [2, 3, 5]
         kernel = numpy.array([1, 1])
         output = ndimage.correlate(array, kernel, origin = -1)
-        self.failUnless(diff(tcor, output) < eps)
+        self.assertTrue(diff(tcor, output) < eps)
         output = ndimage.convolve(array, kernel, origin = -1)
-        self.failUnless(diff(tcov, output) < eps)
+        self.assertTrue(diff(tcov, output) < eps)
         output = ndimage.correlate1d(array, kernel, origin = -1)
-        self.failUnless(diff(tcor, output) < eps)
+        self.assertTrue(diff(tcor, output) < eps)
         output = ndimage.convolve1d(array, kernel, origin = -1)
-        self.failUnless(diff(tcov, output) < eps)
+        self.assertTrue(diff(tcov, output) < eps)
 
     def test_correlate18(self):
         "correlation 18"
@@ -328,12 +328,12 @@
                                         output = numpy.float32,
                                         mode = 'nearest', origin = -1)
             error = diff([[6, 8, 9], [9, 11, 12]], output)
-            self.failUnless(error < eps and
+            self.assertTrue(error < eps and
                             output.dtype.type == numpy.float32)
             output = ndimage.convolve(array, kernel,
                 output = numpy.float32, mode = 'nearest', origin = -1)
             error = diff([[2, 3, 5], [5, 6, 8]], output)
-            self.failUnless(error < eps and
+            self.assertTrue(error < eps and
                             output.dtype.type == numpy.float32)
 
     def test_correlate19(self):
@@ -347,13 +347,13 @@
                                     output = numpy.float32,
                                     mode = 'nearest', origin = [-1, 0])
             error = diff([[5, 6, 8], [8, 9, 11]], output)
-            self.failUnless(error < eps and
+            self.assertTrue(error < eps and
                             output.dtype.type == numpy.float32)
             output = ndimage.convolve(array, kernel,
                                     output = numpy.float32,
                                     mode = 'nearest', origin = [-1, 0])
             error = diff([[3, 5, 6], [6, 8, 9]], output)
-            self.failUnless(error < eps and
+            self.assertTrue(error < eps and
                             output.dtype.type == numpy.float32)
 
     def test_correlate20(self):
@@ -367,10 +367,10 @@
                 output = numpy.zeros((2, 3), type2)
                 ndimage.correlate1d(array, weights, axis = 0,
                                               output = output)
-                self.failUnless(diff(output, true) < eps)
+                self.assertTrue(diff(output, true) < eps)
                 ndimage.convolve1d(array, weights, axis = 0,
                                               output = output)
-                self.failUnless(diff(output, true) < eps)
+                self.assertTrue(diff(output, true) < eps)
 
     def test_correlate21(self):
         "correlation 21"
@@ -379,9 +379,9 @@
         true = [[5, 10, 15], [7, 14, 21]]
         weights = numpy.array([1, 2, 1])
         output = ndimage.correlate1d(array, weights, axis = 0)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
         output = ndimage.convolve1d(array, weights, axis = 0)
-        self.failUnless(diff(output, true) < eps)
+        self.assertTrue(diff(output, true) < eps)
 
     def test_correlate22(self):
         "correlation 22"
@@ -394,10 +394,10 @@
                 output = numpy.zeros((2, 3), type2)
                 ndimage.correlate1d(array, weights, axis = 0,
                                             mode = 'wrap', output = output)
-                self.failUnless(diff(output, true) < eps)
+                self.assertTrue(diff(output, true) < eps)
                 ndimage.convolve1d(array, weights, axis = 0,
                                             mode = 'wrap', output = output)
-                self.failUnless(diff(output, true) < eps)
+                self.assertTrue(diff(output, true) < eps)
 
     def test_correlate23(self):
         "correlation 23"
@@ -410,10 +410,10 @@
                 output = numpy.zeros((2, 3), type2)
                 ndimage.correlate1d(array, weights, axis = 0,
                                          mode = 'nearest', output = output)
-                self.failUnless(diff(output, true) < eps)
+                self.assertTrue(diff(output, true) < eps)
                 ndimage.convolve1d(array, weights, axis = 0,
                                          mode = 'nearest', output = output)
-                self.failUnless(diff(output, true) < eps)
+                self.assertTrue(diff(output, true) < eps)
 
     def test_correlate24(self):
         "correlation 24"
@@ -427,10 +427,10 @@
                 output = numpy.zeros((2, 3), type2)
                 ndimage.correlate1d(array, weights, axis = 0,
                            mode = 'nearest', output = output, origin = -1)
-                self.failUnless(diff(output, tcor) < eps)
+                self.assertTrue(diff(output, tcor) < eps)
                 ndimage.convolve1d(array, weights, axis = 0,
                            mode = 'nearest', output = output, origin = -1)
-                self.failUnless(diff(output, tcov) < eps)
+                self.assertTrue(diff(output, tcov) < eps)
 
     def test_correlate25(self):
         "correlation 25"
@@ -444,24 +444,24 @@
                 output = numpy.zeros((2, 3), type2)
                 ndimage.correlate1d(array, weights, axis = 0,
                              mode = 'nearest', output = output, origin = 1)
-                self.failUnless(diff(output, tcor) < eps)
+                self.assertTrue(diff(output, tcor) < eps)
                 ndimage.convolve1d(array, weights, axis = 0,
                              mode = 'nearest', output = output, origin = 1)
-                self.failUnless(diff(output, tcov) < eps)
+                self.assertTrue(diff(output, tcov) < eps)
 
     def test_gauss01(self):
         "gaussian filter 1"
         input = numpy.array([[1, 2, 3],
                                 [2, 4, 6]], numpy.float32)
         output = ndimage.gaussian_filter(input, 0)
-        self.failUnless(diff(output, input) < eps)
+        self.assertTrue(diff(output, input) < eps)
 
     def test_gauss02(self):
         "gaussian filter 2"
         input = numpy.array([[1, 2, 3],
                                 [2, 4, 6]], numpy.float32)
         output = ndimage.gaussian_filter(input, 1.0)
-        self.failUnless(input.dtype == output.dtype and
+        self.assertTrue(input.dtype == output.dtype and
                         input.shape == output.shape)
 
     def test_gauss03(self):
@@ -470,7 +470,7 @@
         input.shape = (100, 100)
         output = ndimage.gaussian_filter(input, [1.0, 1.0])
 
-        self.failUnless(input.dtype == output.dtype and
+        self.assertTrue(input.dtype == output.dtype and
                         input.shape == output.shape and
                         output.sum(dtype='d') - input.sum(dtype='d') < eps and
                         diff(input, output) > 1.0)
@@ -482,7 +482,7 @@
         otype = numpy.float64
         output = ndimage.gaussian_filter(input, [1.0, 1.0],
                                                             output = otype)
-        self.failUnless(output.dtype.type == numpy.float64 and
+        self.assertTrue(output.dtype.type == numpy.float64 and
                         input.shape == output.shape and
                         diff(input, output) > 1.0)
 
@@ -493,7 +493,7 @@
         otype = numpy.float64
         output = ndimage.gaussian_filter(input, [1.0, 1.0],
                                                  order = 1, output = otype)
-        self.failUnless(output.dtype.type == numpy.float64 and
+        self.assertTrue(output.dtype.type == numpy.float64 and
                         input.shape == output.shape and
                         diff(input, output) > 1.0)
 
@@ -506,7 +506,7 @@
                                                             output = otype)
         output2 = ndimage.gaussian_filter(input, 1.0,
                                                             output = otype)
-        self.failUnless(diff(output1, output2) < eps)
+        self.assertTrue(diff(output1, output2) < eps)
 
     def test_prewitt01(self):
         "prewitt filter 1"
@@ -517,7 +517,7 @@
             t = ndimage.correlate1d(array, [-1.0, 0.0, 1.0], 0)
             t = ndimage.correlate1d(t, [1.0, 1.0, 1.0], 1)
             output = ndimage.prewitt(array, 0)
-            self.failUnless(diff(t, output) < eps)
+            self.assertTrue(diff(t, output) < eps)
 
 
     def test_prewitt02(self):
@@ -530,7 +530,7 @@
             t = ndimage.correlate1d(t, [1.0, 1.0, 1.0], 1)
             output = numpy.zeros(array.shape, type)
             ndimage.prewitt(array, 0, output)
-            self.failUnless(diff(t, output) < eps)
+            self.assertTrue(diff(t, output) < eps)
 
     def test_prewitt03(self):
         "prewitt filter 3"
@@ -541,7 +541,7 @@
             t = ndimage.correlate1d(array, [-1.0, 0.0, 1.0], 1)
             t = ndimage.correlate1d(t, [1.0, 1.0, 1.0], 0)
             output = ndimage.prewitt(array, 1)
-            self.failUnless(diff(t, output) < eps)
+            self.assertTrue(diff(t, output) < eps)
 
     def test_prewitt04(self):
         "prewitt filter 4"
@@ -551,7 +551,7 @@
                                     [5, 6, 9, 3, 5]], type)
             t = ndimage.prewitt(array, -1)
             output = ndimage.prewitt(array, 1)
-            self.failUnless(diff(t, output) < eps)
+            self.assertTrue(diff(t, output) < eps)
 
     def test_sobel01(self):
         "sobel filter 1"
@@ -562,7 +562,7 @@
             t = ndimage.correlate1d(array, [-1.0, 0.0, 1.0], 0)
             t = ndimage.correlate1d(t, [1.0, 2.0, 1.0], 1)
             output = ndimage.sobel(array, 0)
-            self.failUnless(diff(t, output) < eps)
+            self.assertTrue(diff(t, output) < eps)
 
     def test_sobel02(self):
         "sobel filter 2"
@@ -574,7 +574,7 @@
             t = ndimage.correlate1d(t, [1.0, 2.0, 1.0], 1)
             output = numpy.zeros(array.shape, type)
             ndimage.sobel(array, 0, output)
-            self.failUnless(diff(t, output) < eps)
+            self.assertTrue(diff(t, output) < eps)
 
     def test_sobel03(self):
         "sobel filter 3"
@@ -586,7 +586,7 @@
             t = ndimage.correlate1d(t, [1.0, 2.0, 1.0], 0)
             output = numpy.zeros(array.shape, type)
             output = ndimage.sobel(array, 1)
-            self.failUnless(diff(t, output) < eps)
+            self.assertTrue(diff(t, output) < eps)
 
     def test_sobel04(self):
         "sobel filter 4"
@@ -596,7 +596,7 @@
                                     [5, 6, 9, 3, 5]], type)
             t = ndimage.sobel(array, -1)
             output = ndimage.sobel(array, 1)
-            self.failUnless(diff(t, output) < eps)
+            self.assertTrue(diff(t, output) < eps)
 
     def test_laplace01(self):
         "laplace filter 1"
@@ -607,7 +607,7 @@
             tmp1 = ndimage.correlate1d(array, [1, -2, 1], 0)
             tmp2 = ndimage.correlate1d(array, [1, -2, 1], 1)
             output = ndimage.laplace(array)
-            self.failUnless(diff(tmp1 + tmp2, output) < eps)
+            self.assertTrue(diff(tmp1 + tmp2, output) < eps)
 
     def test_laplace02(self):
         "laplace filter 2"
@@ -619,7 +619,7 @@
             tmp2 = ndimage.correlate1d(array, [1, -2, 1], 1)
             output = numpy.zeros(array.shape, type)
             ndimage.laplace(array, output = output)
-            self.failUnless(diff(tmp1 + tmp2, output) < eps)
+            self.assertTrue(diff(tmp1 + tmp2, output) < eps)
 
     def test_gaussian_laplace01(self):
         "gaussian laplace filter 1"
@@ -630,7 +630,7 @@
             tmp1 = ndimage.gaussian_filter(array, 1.0, [2, 0])
             tmp2 = ndimage.gaussian_filter(array, 1.0, [0, 2])
             output = ndimage.gaussian_laplace(array, 1.0)
-            self.failUnless(diff(tmp1 + tmp2, output) < eps)
+            self.assertTrue(diff(tmp1 + tmp2, output) < eps)
 
     def test_gaussian_laplace02(self):
         "gaussian laplace filter 2"
@@ -642,7 +642,7 @@
             tmp2 = ndimage.gaussian_filter(array, 1.0, [0, 2])
             output = numpy.zeros(array.shape, type)
             ndimage.gaussian_laplace(array, 1.0, output)
-            self.failUnless(diff(tmp1 + tmp2, output) < eps)
+            self.assertTrue(diff(tmp1 + tmp2, output) < eps)
 
     def test_generic_laplace01(self):
         "generic laplace filter 1"
@@ -661,7 +661,7 @@
             tmp = ndimage.generic_laplace(array, derivative2,
                     extra_arguments = (1.0,), extra_keywords = {'b': 2.0})
             ndimage.gaussian_laplace(array, 1.0, output)
-            self.failUnless(diff(tmp, output) < eps)
+            self.assertTrue(diff(tmp, output) < eps)
 
     def test_gaussian_gradient_magnitude01(self):
         "gaussian gradient magnitude filter 1"
@@ -675,7 +675,7 @@
                                                                        1.0)
             true = tmp1 * tmp1 + tmp2 * tmp2
             numpy.sqrt(true, true)
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
 
     def test_gaussian_gradient_magnitude02(self):
         "gaussian gradient magnitude filter 2"
@@ -690,7 +690,7 @@
                                                            output)
             true = tmp1 * tmp1 + tmp2 * tmp2
             numpy.sqrt(true, true)
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
 
     def test_generic_gradient_magnitude01(self):
         "generic gradient magnitude 1"
@@ -708,7 +708,7 @@
         tmp2 = ndimage.generic_gradient_magnitude(array,
                 derivative, extra_arguments = (1.0,),
                 extra_keywords = {'b': 2.0})
-        self.failUnless(diff(tmp1, tmp2) < eps)
+        self.assertTrue(diff(tmp1, tmp2) < eps)
 
     def test_uniform01(self):
         "uniform filter 1"
@@ -716,35 +716,35 @@
         size = 2
         output = ndimage.uniform_filter1d(array, size,
                                                    origin = -1)
-        self.failUnless(diff([3, 5, 6], output) < eps)
+        self.assertTrue(diff([3, 5, 6], output) < eps)
 
     def test_uniform02(self):
         "uniform filter 2"
         array = numpy.array([1, 2, 3])
         filter_shape = [0]
         output = ndimage.uniform_filter(array, filter_shape)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
 
     def test_uniform03(self):
         "uniform filter 3"
         array = numpy.array([1, 2, 3])
         filter_shape = [1]
         output = ndimage.uniform_filter(array, filter_shape)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
 
     def test_uniform04(self):
         "uniform filter 4"
         array = numpy.array([2, 4, 6])
         filter_shape = [2]
         output = ndimage.uniform_filter(array, filter_shape)
-        self.failUnless(diff([2, 3, 5], output) < eps)
+        self.assertTrue(diff([2, 3, 5], output) < eps)
 
     def test_uniform05(self):
         "uniform filter 5"
         array = []
         filter_shape = [1]
         output = ndimage.uniform_filter(array, filter_shape)
-        self.failUnless(diff([], output) < eps)
+        self.assertTrue(diff([], output) < eps)
 
     def test_uniform06(self):
         "uniform filter 6"
@@ -756,35 +756,35 @@
                 output = ndimage.uniform_filter(array,
                                         filter_shape, output = type2)
                 error = diff([[4, 6, 10], [10, 12, 16]], output)
-                self.failUnless(error < eps and output.dtype.type == type2)
+                self.assertTrue(error < eps and output.dtype.type == type2)
 
     def test_minimum_filter01(self):
         "minimum filter 1"
         array = numpy.array([1, 2, 3, 4, 5])
         filter_shape = numpy.array([2])
         output = ndimage.minimum_filter(array, filter_shape)
-        self.failUnless(diff([1, 1, 2, 3, 4], output) < eps)
+        self.assertTrue(diff([1, 1, 2, 3, 4], output) < eps)
 
     def test_minimum_filter02(self):
         "minimum filter 2"
         array = numpy.array([1, 2, 3, 4, 5])
         filter_shape = numpy.array([3])
         output = ndimage.minimum_filter(array, filter_shape)
-        self.failUnless(diff([1, 1, 2, 3, 4], output) < eps)
+        self.assertTrue(diff([1, 1, 2, 3, 4], output) < eps)
 
     def test_minimum_filter03(self):
         "minimum filter 3"
         array = numpy.array([3, 2, 5, 1, 4])
         filter_shape = numpy.array([2])
         output = ndimage.minimum_filter(array, filter_shape)
-        self.failUnless(diff([3, 2, 2, 1, 1], output) < eps)
+        self.assertTrue(diff([3, 2, 2, 1, 1], output) < eps)
 
     def test_minimum_filter04(self):
         "minimum filter 4"
         array = numpy.array([3, 2, 5, 1, 4])
         filter_shape = numpy.array([3])
         output = ndimage.minimum_filter(array, filter_shape)
-        self.failUnless(diff([2, 2, 1, 1, 1], output) < eps)
+        self.assertTrue(diff([2, 2, 1, 1, 1], output) < eps)
 
     def test_minimum_filter05(self):
         "minimum filter 5"
@@ -793,7 +793,7 @@
                                 [5, 8, 3, 7, 1]])
         filter_shape = numpy.array([2, 3])
         output = ndimage.minimum_filter(array, filter_shape)
-        self.failUnless(diff([[2, 2, 1, 1, 1],
+        self.assertTrue(diff([[2, 2, 1, 1, 1],
                               [2, 2, 1, 1, 1],
                               [5, 3, 3, 1, 1]], output) < eps)
 
@@ -805,7 +805,7 @@
         footprint = [[1, 1, 1], [1, 1, 1]]
         output = ndimage.minimum_filter(array,
                                                  footprint = footprint)
-        self.failUnless(diff([[2, 2, 1, 1, 1],
+        self.assertTrue(diff([[2, 2, 1, 1, 1],
                               [2, 2, 1, 1, 1],
                               [5, 3, 3, 1, 1]], output) < eps)
 
@@ -817,7 +817,7 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.minimum_filter(array,
                                                  footprint = footprint)
-        self.failUnless(diff([[2, 2, 1, 1, 1],
+        self.assertTrue(diff([[2, 2, 1, 1, 1],
                               [2, 3, 1, 3, 1],
                               [5, 5, 3, 3, 1]], output) < eps)
 
@@ -829,7 +829,7 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.minimum_filter(array,
                                        footprint = footprint, origin = -1)
-        self.failUnless(diff([[3, 1, 3, 1, 1],
+        self.assertTrue(diff([[3, 1, 3, 1, 1],
                               [5, 3, 3, 1, 1],
                               [3, 3, 1, 1, 1]], output) < eps)
 
@@ -841,7 +841,7 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.minimum_filter(array,
                                   footprint = footprint, origin = [-1, 0])
-        self.failUnless(diff([[2, 3, 1, 3, 1],
+        self.assertTrue(diff([[2, 3, 1, 3, 1],
                               [5, 5, 3, 3, 1],
                               [5, 3, 3, 1, 1]], output) < eps)
 
@@ -850,28 +850,28 @@
         array = numpy.array([1, 2, 3, 4, 5])
         filter_shape = numpy.array([2])
         output = ndimage.maximum_filter(array, filter_shape)
-        self.failUnless(diff([1, 2, 3, 4, 5], output) < eps)
+        self.assertTrue(diff([1, 2, 3, 4, 5], output) < eps)
 
     def test_maximum_filter02(self):
         "maximum filter 2"
         array = numpy.array([1, 2, 3, 4, 5])
         filter_shape = numpy.array([3])
         output = ndimage.maximum_filter(array, filter_shape)
-        self.failUnless(diff([2, 3, 4, 5, 5], output) < eps)
+        self.assertTrue(diff([2, 3, 4, 5, 5], output) < eps)
 
     def test_maximum_filter03(self):
         "maximum filter 3"
         array = numpy.array([3, 2, 5, 1, 4])
         filter_shape = numpy.array([2])
         output = ndimage.maximum_filter(array, filter_shape)
-        self.failUnless(diff([3, 3, 5, 5, 4], output) < eps)
+        self.assertTrue(diff([3, 3, 5, 5, 4], output) < eps)
 
     def test_maximum_filter04(self):
         "maximum filter 4"
         array = numpy.array([3, 2, 5, 1, 4])
         filter_shape = numpy.array([3])
         output = ndimage.maximum_filter(array, filter_shape)
-        self.failUnless(diff([3, 5, 5, 5, 4], output) < eps)
+        self.assertTrue(diff([3, 5, 5, 5, 4], output) < eps)
 
     def test_maximum_filter05(self):
         "maximum filter 5"
@@ -880,7 +880,7 @@
                                 [5, 8, 3, 7, 1]])
         filter_shape = numpy.array([2, 3])
         output = ndimage.maximum_filter(array, filter_shape)
-        self.failUnless(diff([[3, 5, 5, 5, 4],
+        self.assertTrue(diff([[3, 5, 5, 5, 4],
                               [7, 9, 9, 9, 5],
                               [8, 9, 9, 9, 7]], output) < eps)
 
@@ -892,7 +892,7 @@
         footprint = [[1, 1, 1], [1, 1, 1]]
         output = ndimage.maximum_filter(array,
                                                  footprint = footprint)
-        self.failUnless(diff([[3, 5, 5, 5, 4],
+        self.assertTrue(diff([[3, 5, 5, 5, 4],
                               [7, 9, 9, 9, 5],
                               [8, 9, 9, 9, 7]], output) < eps)
 
@@ -904,7 +904,7 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.maximum_filter(array,
                                                  footprint = footprint)
-        self.failUnless(diff([[3, 5, 5, 5, 4],
+        self.assertTrue(diff([[3, 5, 5, 5, 4],
                               [7, 7, 9, 9, 5],
                               [7, 9, 8, 9, 7]], output) < eps)
 
@@ -916,7 +916,7 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.maximum_filter(array,
                                       footprint = footprint, origin = -1)
-        self.failUnless(diff([[7, 9, 9, 5, 5],
+        self.assertTrue(diff([[7, 9, 9, 5, 5],
                               [9, 8, 9, 7, 5],
                               [8, 8, 7, 7, 7]], output) < eps)
 
@@ -928,7 +928,7 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.maximum_filter(array,
                                  footprint = footprint, origin = [-1, 0])
-        self.failUnless(diff([[7, 7, 9, 9, 5],
+        self.assertTrue(diff([[7, 7, 9, 9, 5],
                               [7, 9, 8, 9, 7],
                               [8, 8, 8, 7, 7]], output) < eps)
 
@@ -936,47 +936,47 @@
         "rank filter 1"
         array = numpy.array([1, 2, 3, 4, 5])
         output = ndimage.rank_filter(array, 1, size = 2)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.percentile_filter(array, 100, size = 2)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.median_filter(array, 2)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
 
     def test_rank02(self):
         "rank filter 2"
         array = numpy.array([1, 2, 3, 4, 5])
         output = ndimage.rank_filter(array, 1, size = [3])
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.percentile_filter(array, 50, size = 3)
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
         output = ndimage.median_filter(array, (3,))
-        self.failUnless(diff(array, output) < eps)
+        self.assertTrue(diff(array, output) < eps)
 
     def test_rank03(self):
         "rank filter 3"
         array = numpy.array([3, 2, 5, 1, 4])
         output = ndimage.rank_filter(array, 1, size = [2])
-        self.failUnless(diff([3, 3, 5, 5, 4], output) < eps)
+        self.assertTrue(diff([3, 3, 5, 5, 4], output) < eps)
         output = ndimage.percentile_filter(array, 100, size = 2)
-        self.failUnless(diff([3, 3, 5, 5, 4], output) < eps)
+        self.assertTrue(diff([3, 3, 5, 5, 4], output) < eps)
 
     def test_rank04(self):
         "rank filter 4"
         array = numpy.array([3, 2, 5, 1, 4])
         true = [3, 3, 2, 4, 4]
         output = ndimage.rank_filter(array, 1, size = 3)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
         output = ndimage.percentile_filter(array, 50, size = 3)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
         output = ndimage.median_filter(array, size = 3)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_rank05(self):
         "rank filter 5"
         array = numpy.array([3, 2, 5, 1, 4])
         true = [3, 3, 2, 4, 4]
         output = ndimage.rank_filter(array, -2, size = 3)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_rank06(self):
         "rank filter 6"
@@ -987,10 +987,10 @@
                 [3, 3, 2, 1, 1],
                 [5, 5, 3, 3, 1]]
         output = ndimage.rank_filter(array, 1, size = [2, 3])
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
         output = ndimage.percentile_filter(array, 17,
                                                     size = (2, 3))
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_rank07(self):
         "rank filter 7"
@@ -1001,7 +1001,7 @@
                 [5, 5, 7, 5, 4],
                 [6, 8, 8, 7, 5]]
         output = ndimage.rank_filter(array, -2, size = [2, 3])
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_rank08(self):
         "median filter 8"
@@ -1014,11 +1014,11 @@
         kernel = numpy.array([2, 3])
         output = ndimage.percentile_filter(array, 50.0,
                                                     size = (2, 3))
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
         output = ndimage.rank_filter(array, 3, size = (2, 3))
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
         output = ndimage.median_filter(array, size = (2, 3))
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_rank09(self):
         "rank filter 9"
@@ -1032,10 +1032,10 @@
                                     [5, 6, 9, 3, 5]], type)
             output = ndimage.rank_filter(array, 1,
                                                   footprint = footprint)
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
             output = ndimage.percentile_filter(array, 35,
                                                     footprint = footprint)
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
 
     def test_rank10(self):
         "rank filter 10"
@@ -1048,10 +1048,10 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.rank_filter(array, 0,
                                               footprint = footprint)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
         output = ndimage.percentile_filter(array, 0.0,
                                                     footprint = footprint)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_rank11(self):
         "rank filter 11"
@@ -1064,10 +1064,10 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.rank_filter(array, -1,
                                               footprint = footprint)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
         output = ndimage.percentile_filter(array, 100.0,
                                                     footprint = footprint)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
 
     def test_rank12(self):
@@ -1082,13 +1082,13 @@
                                     [5, 6, 9, 3, 5]], type)
             output = ndimage.rank_filter(array, 1,
                                                   footprint = footprint)
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
             output = ndimage.percentile_filter(array, 50.0,
                                                      footprint = footprint)
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
             output = ndimage.median_filter(array,
                                                     footprint = footprint)
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
 
     def test_rank13(self):
         "rank filter 13"
@@ -1102,7 +1102,7 @@
                                     [5, 6, 9, 3, 5]], type)
             output = ndimage.rank_filter(array, 1,
                                        footprint = footprint, origin = -1)
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
 
     def test_rank14(self):
         "rank filter 14"
@@ -1116,7 +1116,7 @@
                                     [5, 6, 9, 3, 5]], type)
             output = ndimage.rank_filter(array, 1,
                                   footprint = footprint, origin = [-1, 0])
-            self.failUnless(diff(true, output) < eps)
+            self.assertTrue(diff(true, output) < eps)
 
     def test_generic_filter1d01(self):
         "generic 1d filter 1"
@@ -1135,7 +1135,7 @@
             r2 = ndimage.generic_filter1d(a, _filter_func, 3,
                       axis = 0, origin = -1, extra_arguments = (weights,),
                       extra_keywords = {'total': weights.sum()})
-            self.failUnless(diff(r1, r2) < eps)
+            self.assertTrue(diff(r1, r2) < eps)
 
     def test_generic_filter01(self):
         "generic filter 1"
@@ -1153,7 +1153,7 @@
             r2 = ndimage.generic_filter(a, _filter_func,
                             footprint = footprint, extra_arguments = (cf,),
                             extra_keywords = {'total': cf.sum()})
-            self.failUnless(diff(r1, r2) < eps,
+            self.assertTrue(diff(r1, r2) < eps,
                             "%r\n%r" % (r1, r2))
 
     def test_extend01(self):
@@ -1352,7 +1352,7 @@
                                                        shape[0], 0)
                 a = fft.ifft(a, shape[1], 1)
                 a = fft.irfft(a, shape[0], 0)
-                self.failUnless(diff(ndimage.sum(a), 1.0) < eps)
+                self.assertTrue(diff(ndimage.sum(a), 1.0) < eps)
 
     def test_fourier_gaussian_complex01(self):
         "gaussian fourier filter for complex transforms 1"
@@ -1367,7 +1367,7 @@
                 a = fft.ifft(a, shape[1], 1)
                 a = fft.ifft(a, shape[0], 0)
                 error = diff(ndimage.sum(a.real), 1.0)
-                self.failUnless(error < eps)
+                self.assertTrue(error < eps)
 
     def test_fourier_uniform_real01(self):
         "uniform fourier filter for real transforms 1"
@@ -1381,7 +1381,7 @@
                                                       shape[0], 0)
                 a = fft.ifft(a, shape[1], 1)
                 a = fft.irfft(a, shape[0], 0)
-                self.failUnless(diff(ndimage.sum(a), 1.0) < eps)
+                self.assertTrue(diff(ndimage.sum(a), 1.0) < eps)
 
     def test_fourier_uniform_complex01(self):
         "uniform fourier filter for complex transforms 1"
@@ -1395,7 +1395,7 @@
                 a = fft.ifft(a, shape[1], 1)
                 a = fft.ifft(a, shape[0], 0)
                 error = diff(ndimage.sum(a.real), 1.0)
-                self.failUnless(error < eps)
+                self.assertTrue(error < eps)
 
     def test_fourier_shift_real01(self):
         "shift filter for real transforms 1"
@@ -1410,7 +1410,7 @@
                 a = fft.irfft(a, shape[0], 0)
                 error1 = diff(a[1:, 1:], true[:-1, :-1])
                 error2 = diff(a.imag, numpy.zeros(shape))
-                self.failUnless(error1 < 1e-10 and error2 < 1e-10)
+                self.assertTrue(error1 < 1e-10 and error2 < 1e-10)
 
     def test_fourier_shift_complex01(self):
         "shift filter for complex transforms 1"
@@ -1426,7 +1426,7 @@
                 a = fft.ifft(a, shape[0], 0)
                 error1 = diff(a.real[1:, 1:], true[:-1, :-1])
                 error2 = diff(a.imag, numpy.zeros(shape))
-                self.failUnless(error1 < 1e-10 and error2 < 1e-10)
+                self.assertTrue(error1 < 1e-10 and error2 < 1e-10)
 
     def test_fourier_ellipsoid_real01(self):
         "ellipsoid fourier filter for real transforms 1"
@@ -1440,7 +1440,7 @@
                                                         shape[0], 0)
                 a = fft.ifft(a, shape[1], 1)
                 a = fft.irfft(a, shape[0], 0)
-                self.failUnless(diff(ndimage.sum(a), 1.0) < eps)
+                self.assertTrue(diff(ndimage.sum(a), 1.0) < eps)
 
     def test_fourier_ellipsoid_complex01(self):
         "ellipsoid fourier filter for complex transforms 1"
@@ -1455,7 +1455,7 @@
                 a = fft.ifft(a, shape[1], 1)
                 a = fft.ifft(a, shape[0], 0)
                 error = diff(ndimage.sum(a.real), 1.0)
-                self.failUnless(error < eps)
+                self.assertTrue(error < eps)
 
     def test_spline01(self):
         "spline filter 1"
@@ -1463,7 +1463,7 @@
             data = numpy.ones([], type)
             for order in range(2, 6):
                 out = ndimage.spline_filter(data, order = order)
-                self.failUnless(diff(out, 1)< eps and
+                self.assertTrue(diff(out, 1)< eps and
                                 out.dtype.type == numpy.float64)
 
     def test_spline02(self):
@@ -1472,7 +1472,7 @@
             data = numpy.array([1])
             for order in range(2, 6):
                 out = ndimage.spline_filter(data, order = order)
-                self.failUnless(diff(out, [1]) < eps and
+                self.assertTrue(diff(out, [1]) < eps and
                                 out.dtype.type == numpy.float64)
 
     def test_spline03(self):
@@ -1482,7 +1482,7 @@
             for order in range(2, 6):
                 out = ndimage.spline_filter(data, order,
                                                       output = type)
-                self.failUnless(diff(out, 1) < eps and
+                self.assertTrue(diff(out, 1) < eps and
                                 out.dtype.type == type)
 
     def test_spline04(self):
@@ -1491,7 +1491,7 @@
             data = numpy.ones([4], type)
             for order in range(2, 6):
                 out = ndimage.spline_filter(data, order)
-                self.failUnless(diff(out, [1, 1, 1, 1]) < eps)
+                self.assertTrue(diff(out, [1, 1, 1, 1]) < eps)
 
     def test_spline05(self):
         "spline filter 5"
@@ -1499,7 +1499,7 @@
             data = numpy.ones([4, 4], type)
             for order in range(2, 6):
                 out = ndimage.spline_filter(data, order = order)
-                self.failUnless(diff(out, [[1, 1, 1, 1],
+                self.assertTrue(diff(out, [[1, 1, 1, 1],
                                            [1, 1, 1, 1],
                                            [1, 1, 1, 1],
                                            [1, 1, 1, 1]]) < eps)
@@ -1513,7 +1513,7 @@
             out = ndimage.geometric_transform(data, mapping,
                                                         data.shape,
                                                         order=order)
-            self.failUnless(diff(out, [1]) < eps)
+            self.assertTrue(diff(out, [1]) < eps)
 
     def test_geometric_transform02(self):
         "geometric transform 2"
@@ -1523,7 +1523,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                   data.shape, order=order)
-            self.failUnless(diff(out, [1, 1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1, 1]) < eps)
 
     def test_geometric_transform03(self):
         "geometric transform 3"
@@ -1533,7 +1533,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                    data.shape, order=order)
-            self.failUnless(diff(out, [0, 1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [0, 1, 1, 1]) < eps)
 
     def test_geometric_transform04(self):
         "geometric transform 4"
@@ -1543,7 +1543,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                    data.shape, order=order)
-            self.failUnless(diff(out, [0, 4, 1, 3]) < eps)
+            self.assertTrue(diff(out, [0, 4, 1, 3]) < eps)
 
     def test_geometric_transform05(self):
         "geometric transform 5"
@@ -1555,7 +1555,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                    data.shape, order=order)
-            self.failUnless(diff(out, [[0, 1, 1, 1],
+            self.assertTrue(diff(out, [[0, 1, 1, 1],
                                        [0, 1, 1, 1],
                                        [0, 1, 1, 1]]) < eps)
 
@@ -1569,7 +1569,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                    data.shape, order=order)
-            self.failUnless(diff(out, [[0, 4, 1, 3],
+            self.assertTrue(diff(out, [[0, 4, 1, 3],
                                        [0, 7, 6, 8],
                                        [0, 3, 5, 3]]) < eps)
 
@@ -1583,7 +1583,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                    data.shape, order=order)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [4, 1, 3, 2],
                                        [7, 6, 8, 5]]) < eps)
 
@@ -1597,7 +1597,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                    data.shape, order=order)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [0, 4, 1, 3],
                                        [0, 7, 6, 8]]) < eps)
 
@@ -1616,7 +1616,7 @@
                 filtered = data
             out = ndimage.geometric_transform(filtered, mapping,
                                data.shape, order=order, prefilter = False)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [0, 4, 1, 3],
                                        [0, 7, 6, 8]]) < eps)
 
@@ -1628,7 +1628,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                         [4], order=order)
-            self.failUnless(diff(out, [1, 1, 1, 1]) < eps,
+            self.assertTrue(diff(out, [1, 1, 1, 1]) < eps,
                             "%r" % out)
 
     def test_geometric_transform14(self):
@@ -1639,7 +1639,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                         [4], order=order)
-            self.failUnless(diff(out, [1, 2, 3, 4]) < eps)
+            self.assertTrue(diff(out, [1, 2, 3, 4]) < eps)
 
     def test_geometric_transform15(self):
         "geometric transform 15"
@@ -1649,7 +1649,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                         [8], order=order)
-            self.failUnless(diff(out[::2], [1, 2, 3, 4]) < eps)
+            self.assertTrue(diff(out[::2], [1, 2, 3, 4]) < eps)
 
     def test_geometric_transform16(self):
         "geometric transform 16"
@@ -1661,7 +1661,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                        (3, 2), order=order)
-            self.failUnless(diff(out, [[1, 3], [5, 7], [9, 11]]) < eps)
+            self.assertTrue(diff(out, [[1, 3], [5, 7], [9, 11]]) < eps)
 
     def test_geometric_transform17(self):
         "geometric transform 17"
@@ -1673,7 +1673,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                        (1, 4), order=order)
-            self.failUnless(diff(out, [[1, 2, 3, 4]]) < eps)
+            self.assertTrue(diff(out, [[1, 2, 3, 4]]) < eps)
 
     def test_geometric_transform18(self):
         "geometric transform 18"
@@ -1685,7 +1685,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                        (1, 2), order=order)
-            self.failUnless(diff(out, [[1, 3]]) < eps)
+            self.assertTrue(diff(out, [[1, 3]]) < eps)
 
     def test_geometric_transform19(self):
         "geometric transform 19"
@@ -1697,7 +1697,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                        (3, 8), order=order)
-            self.failUnless(diff(out[..., ::2], data) < eps)
+            self.assertTrue(diff(out[..., ::2], data) < eps)
 
     def test_geometric_transform20(self):
         "geometric transform 20"
@@ -1709,7 +1709,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                        (6, 4), order=order)
-            self.failUnless(diff(out[::2, ...], data) < eps)
+            self.assertTrue(diff(out[::2, ...], data) < eps)
 
     def test_geometric_transform21(self):
         "geometric transform 21"
@@ -1721,7 +1721,7 @@
         for order in range(0, 6):
             out = ndimage.geometric_transform(data, mapping,
                                                       (6, 8), order=order)
-            self.failUnless(diff(out[::2, ::2], data) < eps)
+            self.assertTrue(diff(out[::2, ::2], data) < eps)
 
 
     def test_geometric_transform22(self):
@@ -1739,7 +1739,7 @@
             out = ndimage.geometric_transform(out, mapping2,
                                                        (3, 4), order=order)
             error = diff(out, data)
-            self.failUnless(diff(out, data) < eps)
+            self.assertTrue(diff(out, data) < eps)
 
     def test_geometric_transform23(self):
         "geometric transform 23"
@@ -1752,7 +1752,7 @@
             out = ndimage.geometric_transform(data, mapping,
                                                         (2,), order=order)
             out = out.astype(numpy.int32)
-            self.failUnless(diff(out, [5, 7]) < eps)
+            self.assertTrue(diff(out, [5, 7]) < eps)
 
     def test_geometric_transform24(self):
         "geometric transform 24"
@@ -1765,7 +1765,7 @@
             out = ndimage.geometric_transform(data, mapping,
                                 (2,), order=order, extra_arguments = (1,),
                                 extra_keywords = {'b': 2})
-            self.failUnless(diff(out, [5, 7]) < eps)
+            self.assertTrue(diff(out, [5, 7]) < eps)
 
     def test_map_coordinates01(self):
         "map coordinates 1"
@@ -1776,7 +1776,7 @@
         idx -= 1
         for order in range(0, 6):
             out = ndimage.map_coordinates(data, idx, order=order)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [0, 4, 1, 3],
                                        [0, 7, 6, 8]]) < eps)
 
@@ -1791,7 +1791,7 @@
             out1 = ndimage.shift(data, 0.5, order=order)
             out2 = ndimage.map_coordinates(data, idx,
                                                      order=order)
-            self.failUnless(diff(out1, out2) < eps)
+            self.assertTrue(diff(out1, out2) < eps)
 
     def test_affine_transform01(self):
         "affine_transform 1"
@@ -1799,7 +1799,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[1]],
                                                      order=order)
-            self.failUnless(diff(out, [1]) < eps)
+            self.assertTrue(diff(out, [1]) < eps)
 
     def test_affine_transform02(self):
         "affine transform 2"
@@ -1807,7 +1807,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[1]],
                                                      order=order)
-            self.failUnless(diff(out, [1, 1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1, 1]) < eps)
 
     def test_affine_transform03(self):
         "affine transform 3"
@@ -1815,7 +1815,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[1]], -1,
                                                      order=order)
-            self.failUnless(diff(out, [0, 1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [0, 1, 1, 1]) < eps)
 
     def test_affine_transform04(self):
         "affine transform 4"
@@ -1823,7 +1823,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[1]], -1,
                                                      order=order)
-            self.failUnless(diff(out, [0, 4, 1, 3]) < eps)
+            self.assertTrue(diff(out, [0, 4, 1, 3]) < eps)
 
     def test_affine_transform05(self):
         "affine transform 5"
@@ -1834,7 +1834,7 @@
             out = ndimage.affine_transform(data, [[1, 0],
                                                             [0, 1]],
                                                      [0, -1], order=order)
-            self.failUnless(diff(out, [[0, 1, 1, 1],
+            self.assertTrue(diff(out, [[0, 1, 1, 1],
                                        [0, 1, 1, 1],
                                        [0, 1, 1, 1]]) < eps)
 
@@ -1847,7 +1847,7 @@
             out = ndimage.affine_transform(data, [[1, 0],
                                                             [0, 1]],
                                                      [0, -1], order=order)
-            self.failUnless(diff(out, [[0, 4, 1, 3],
+            self.assertTrue(diff(out, [[0, 4, 1, 3],
                                        [0, 7, 6, 8],
                                        [0, 3, 5, 3]]) < eps)
 
@@ -1860,7 +1860,7 @@
             out = ndimage.affine_transform(data, [[1, 0],
                                                             [0, 1]],
                                                      [-1, 0], order=order)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [4, 1, 3, 2],
                                        [7, 6, 8, 5]]) < eps)
 
@@ -1873,7 +1873,7 @@
             out = ndimage.affine_transform(data, [[1, 0],
                                                             [0, 1]],
                                                      [-1, -1], order=order)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [0, 4, 1, 3],
                                        [0, 7, 6, 8]]) < eps)
 
@@ -1891,7 +1891,7 @@
             out = ndimage.affine_transform(filtered,[[1, 0],
                                                                [0, 1]],
                                   [-1, -1], order=order, prefilter = False)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [0, 4, 1, 3],
                                        [0, 7, 6, 8]]) < eps)
 
@@ -1901,7 +1901,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[0.5]],
                                           output_shape = (4,), order=order)
-            self.failUnless(diff(out, [1, 1, 1, 0]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1, 0]) < eps)
 
     def test_affine_transform11(self):
         "affine transform 11"
@@ -1909,7 +1909,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[2]], 0, (4,),
                                                      order=order)
-            self.failUnless(diff(out, [1, 2, 3, 4]) < eps)
+            self.assertTrue(diff(out, [1, 2, 3, 4]) < eps)
 
     def test_affine_transform12(self):
         "affine transform 12"
@@ -1917,7 +1917,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[0.5]], 0,
                                                      (8,), order=order)
-            self.failUnless(diff(out[::2], [1, 2, 3, 4]) < eps)
+            self.assertTrue(diff(out[::2], [1, 2, 3, 4]) < eps)
 
     def test_affine_transform13(self):
         "affine transform 13"
@@ -1928,7 +1928,7 @@
             out = ndimage.affine_transform(data, [[1, 0],
                                                             [0, 2]], 0,
                                                      (3, 2), order=order)
-            self.failUnless(diff(out, [[1, 3], [5, 7], [9, 11]]) < eps)
+            self.assertTrue(diff(out, [[1, 3], [5, 7], [9, 11]]) < eps)
 
     def test_affine_transform14(self):
         "affine transform 14"
@@ -1939,7 +1939,7 @@
             out = ndimage.affine_transform(data, [[2, 0],
                                                             [0, 1]], 0,
                                                      (1, 4), order=order)
-            self.failUnless(diff(out, [[1, 2, 3, 4]]) < eps)
+            self.assertTrue(diff(out, [[1, 2, 3, 4]]) < eps)
 
     def test_affine_transform15(self):
         "affine transform 15"
@@ -1950,7 +1950,7 @@
             out = ndimage.affine_transform(data, [[2, 0],
                                                             [0, 2]], 0,
                                                      (1, 2), order=order)
-            self.failUnless(diff(out, [[1, 3]]) < eps)
+            self.assertTrue(diff(out, [[1, 3]]) < eps)
 
     def test_affine_transform16(self):
         "affine transform 16"
@@ -1961,7 +1961,7 @@
             out = ndimage.affine_transform(data, [[1, 0.0],
                                                             [0, 0.5]], 0,
                                                      (3, 8), order=order)
-            self.failUnless(diff(out[..., ::2], data) < eps)
+            self.assertTrue(diff(out[..., ::2], data) < eps)
 
     def test_affine_transform17(self):
         "affine transform 17"
@@ -1972,7 +1972,7 @@
             out = ndimage.affine_transform(data, [[0.5, 0],
                                                             [0,   1]], 0,
                                                      (6, 4), order=order)
-            self.failUnless(diff(out[::2, ...], data) < eps)
+            self.assertTrue(diff(out[::2, ...], data) < eps)
 
     def test_affine_transform18(self):
         "affine transform 18"
@@ -1984,7 +1984,7 @@
                                                      [[0.5, 0],
                                                       [0, 0.5]], 0,
                                                      (6, 8), order=order)
-            self.failUnless(diff(out[::2, ::2], data) < eps)
+            self.assertTrue(diff(out[::2, ::2], data) < eps)
 
     def test_affine_transform19(self):
         "affine transform 19"
@@ -2000,7 +2000,7 @@
                                                      [[2.0, 0],
                                                       [0, 2.0]], 0,
                                                      (3, 4), order=order)
-            self.failUnless(diff(out, data) < eps)
+            self.assertTrue(diff(out, data) < eps)
 
     def test_affine_transform20(self):
         "affine transform 20"
@@ -2010,7 +2010,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[0], [2]], 0,
                                                      (2,), order=order)
-            self.failUnless(diff(out, [1, 3]) < eps)
+            self.assertTrue(diff(out, [1, 3]) < eps)
 
     def test_affine_transform21(self):
         "affine transform 21"
@@ -2020,35 +2020,35 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [[2], [0]], 0,
                                                      (2,), order=order)
-            self.failUnless(diff(out, [1, 9]) < eps)
+            self.assertTrue(diff(out, [1, 9]) < eps)
 
     def test_shift01(self):
         "shift 1"
         data = numpy.array([1])
         for order in range(0, 6):
             out = ndimage.shift(data, [1], order=order)
-            self.failUnless(diff(out, [0]) < eps)
+            self.assertTrue(diff(out, [0]) < eps)
 
     def test_shift02(self):
         "shift 2"
         data = numpy.ones([4])
         for order in range(0, 6):
             out = ndimage.shift(data, [1], order=order)
-            self.failUnless(diff(out, [0, 1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [0, 1, 1, 1]) < eps)
 
     def test_shift03(self):
         "shift 3"
         data = numpy.ones([4])
         for order in range(0, 6):
             out = ndimage.shift(data, -1, order=order)
-            self.failUnless(diff(out, [1, 1, 1, 0]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1, 0]) < eps)
 
     def test_shift04(self):
         "shift 4"
         data = numpy.array([4, 1, 3, 2])
         for order in range(0, 6):
             out = ndimage.shift(data, 1, order=order)
-            self.failUnless(diff(out, [0, 4, 1, 3]) < eps)
+            self.assertTrue(diff(out, [0, 4, 1, 3]) < eps)
 
     def test_shift05(self):
         "shift 5"
@@ -2057,7 +2057,7 @@
                                [1, 1, 1, 1]])
         for order in range(0, 6):
             out = ndimage.shift(data, [0, 1], order=order)
-            self.failUnless(diff(out, [[0, 1, 1, 1],
+            self.assertTrue(diff(out, [[0, 1, 1, 1],
                                        [0, 1, 1, 1],
                                        [0, 1, 1, 1]]) < eps)
 
@@ -2068,7 +2068,7 @@
                                [3, 5, 3, 6]])
         for order in range(0, 6):
             out = ndimage.shift(data, [0, 1], order=order)
-            self.failUnless(diff(out, [[0, 4, 1, 3],
+            self.assertTrue(diff(out, [[0, 4, 1, 3],
                                        [0, 7, 6, 8],
                                        [0, 3, 5, 3]]) < eps)
 
@@ -2079,7 +2079,7 @@
                                [3, 5, 3, 6]])
         for order in range(0, 6):
             out = ndimage.shift(data, [1, 0], order=order)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [4, 1, 3, 2],
                                        [7, 6, 8, 5]]) < eps)
 
@@ -2091,7 +2091,7 @@
                                [3, 5, 3, 6]])
         for order in range(0, 6):
             out = ndimage.shift(data, [1, 1], order=order)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [0, 4, 1, 3],
                                        [0, 7, 6, 8]]) < eps)
 
@@ -2108,7 +2108,7 @@
                 filtered = data
             out = ndimage.shift(filtered, [1, 1], order=order,
                                           prefilter = False)
-            self.failUnless(diff(out, [[0, 0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0, 0],
                                        [0, 4, 1, 3],
                                        [0, 7, 6, 8]]) < eps)
 
@@ -2139,7 +2139,7 @@
         for order in range(0, 6):
             out = ndimage.affine_transform(data, [0.5, 0.5], 0,
                                                      (6, 8), order=order)
-            self.failUnless(diff(out[::2, ::2], data) < eps)
+            self.assertTrue(diff(out[::2, ::2], data) < eps)
 
     def test_rotate01(self):
         "rotate 1"
@@ -2148,7 +2148,7 @@
                                [0, 0, 0, 0]], dtype = numpy.float64)
         for order in range(0, 6):
             out = ndimage.rotate(data, 0)
-            self.failUnless(diff(out, data) < eps)
+            self.assertTrue(diff(out, data) < eps)
 
     def test_rotate02(self):
         "rotate 2"
@@ -2161,7 +2161,7 @@
                                [0, 0, 0]], dtype = numpy.float64)
         for order in range(0, 6):
             out = ndimage.rotate(data, 90)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_rotate03(self):
         "rotate 3"
@@ -2175,7 +2175,7 @@
                                [0, 0, 0]], dtype = numpy.float64)
         for order in range(0, 6):
             out = ndimage.rotate(data, 90)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_rotate04(self):
         "rotate 4"
@@ -2187,7 +2187,7 @@
                                [0, 0, 1, 0, 0]], dtype = numpy.float64)
         for order in range(0, 6):
             out = ndimage.rotate(data, 90, reshape = False)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_rotate05(self):
         "rotate 5"
@@ -2205,7 +2205,7 @@
         for order in range(0, 6):
             out = ndimage.rotate(data, 90)
             for i in range(3):
-                self.failUnless(diff(out[:,:,i], true) < eps)
+                self.assertTrue(diff(out[:,:,i], true) < eps)
 
     def test_rotate06(self):
         "rotate 6"
@@ -2223,7 +2223,7 @@
         for order in range(0, 6):
             out = ndimage.rotate(data, 90)
             for i in range(3):
-                self.failUnless(diff(out[:,:,i], true) < eps)
+                self.assertTrue(diff(out[:,:,i], true) < eps)
 
     def test_rotate07(self):
         "rotate 7"
@@ -2241,7 +2241,7 @@
 
         for order in range(0, 6):
             out = ndimage.rotate(data, 90, axes = (0, 1))
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_rotate08(self):
         "rotate 8"
@@ -2258,7 +2258,7 @@
         for order in range(0, 6):
             out = ndimage.rotate(data, 90, axes = (0, 1),
                                            reshape = False)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_watershed_ift01(self):
         "watershed_ift 1"
@@ -2291,7 +2291,7 @@
                       [-1,  1,  1,  1,  1,  1, -1],
                       [-1, -1, -1, -1, -1, -1, -1],
                       [-1, -1, -1, -1, -1, -1, -1]], out)
-        self.failUnless(error < eps)
+        self.assertTrue(error < eps)
 
     def test_watershed_ift02(self):
         "watershed_ift 2"
@@ -2321,7 +2321,7 @@
                       [-1, -1,  1,  1,  1, -1, -1],
                       [-1, -1, -1, -1, -1, -1, -1],
                       [-1, -1, -1, -1, -1, -1, -1]], out)
-        self.failUnless(error < eps)
+        self.assertTrue(error < eps)
 
     def test_watershed_ift03(self):
         "watershed_ift 3"
@@ -2348,7 +2348,7 @@
                       [-1,  2,  2,  3,  3,  3, -1],
                       [-1, -1,  2, -1,  3, -1, -1],
                       [-1, -1, -1, -1, -1, -1, -1]], out)
-        self.failUnless(error < eps)
+        self.assertTrue(error < eps)
 
     def test_watershed_ift04(self):
         "watershed_ift 4"
@@ -2378,7 +2378,7 @@
                       [-1,  2,  2,  3,  3,  3, -1],
                       [-1,  2,  2,  3,  3,  3, -1],
                       [-1, -1, -1, -1, -1, -1, -1]], out)
-        self.failUnless(error < eps)
+        self.assertTrue(error < eps)
 
     def test_watershed_ift05(self):
         "watershed_ift 5"
@@ -2408,7 +2408,7 @@
                       [-1,  3,  3,  2,  2,  2, -1],
                       [-1,  3,  3,  2,  2,  2, -1],
                       [-1, -1, -1, -1, -1, -1, -1]], out)
-        self.failUnless(error < eps)
+        self.assertTrue(error < eps)
 
     def test_watershed_ift06(self):
         "watershed_ift 6"
@@ -2435,7 +2435,7 @@
                       [-1,  1,  1,  1,  1,  1, -1],
                       [-1, -1, -1, -1, -1, -1, -1],
                       [-1, -1, -1, -1, -1, -1, -1]], out)
-        self.failUnless(error < eps)
+        self.assertTrue(error < eps)
 
     def test_watershed_ift07(self):
         "watershed_ift 7"
@@ -2468,43 +2468,43 @@
                       [-1,  1,  1,  1,  1,  1, -1],
                       [-1, -1, -1, -1, -1, -1, -1],
                       [-1, -1, -1, -1, -1, -1, -1]], out)
-        self.failUnless(error < eps)
+        self.assertTrue(error < eps)
 
     def test_label01(self):
         "label 1"
         data = numpy.ones([])
         out, n = ndimage.label(data)
-        self.failUnless(diff(out, 1) < eps and n == 1)
+        self.assertTrue(diff(out, 1) < eps and n == 1)
 
     def test_label02(self):
         "label 2"
         data = numpy.zeros([])
         out, n = ndimage.label(data)
-        self.failUnless(diff(out, 0) < eps and n == 0)
+        self.assertTrue(diff(out, 0) < eps and n == 0)
 
     def test_label03(self):
         "label 3"
         data = numpy.ones([1])
         out, n = ndimage.label(data)
-        self.failUnless(diff(out, [1]) < eps and n == 1)
+        self.assertTrue(diff(out, [1]) < eps and n == 1)
 
     def test_label04(self):
         "label 4"
         data = numpy.zeros([1])
         out, n = ndimage.label(data)
-        self.failUnless(diff(out, [0]) < eps and n == 0)
+        self.assertTrue(diff(out, [0]) < eps and n == 0)
 
     def test_label05(self):
         "label 5"
         data = numpy.ones([5])
         out, n = ndimage.label(data)
-        self.failUnless(diff(out, [1, 1, 1, 1, 1]) < eps and n == 1)
+        self.assertTrue(diff(out, [1, 1, 1, 1, 1]) < eps and n == 1)
 
     def test_label06(self):
         "label 6"
         data = numpy.array([1, 0, 1, 1, 0, 1])
         out, n = ndimage.label(data)
-        self.failUnless(diff(out, [1, 0, 2, 2, 0, 3]) < eps and n == 3)
+        self.assertTrue(diff(out, [1, 0, 2, 2, 0, 3]) < eps and n == 3)
 
     def test_label07(self):
         "label 7"
@@ -2515,7 +2515,7 @@
                                [0, 0, 0, 0, 0, 0],
                                [0, 0, 0, 0, 0, 0]])
         out, n = ndimage.label(data)
-        self.failUnless(diff(out, [[0, 0, 0, 0, 0, 0],
+        self.assertTrue(diff(out, [[0, 0, 0, 0, 0, 0],
                                    [0, 0, 0, 0, 0, 0],
                                    [0, 0, 0, 0, 0, 0],
                                    [0, 0, 0, 0, 0, 0],
@@ -2531,7 +2531,7 @@
                                [1, 1, 0, 0, 0, 0],
                                [0, 0, 0, 1, 1, 0]])
         out, n = ndimage.label(data)
-        self.failUnless(diff(out, [[1, 0, 0, 0, 0, 0],
+        self.assertTrue(diff(out, [[1, 0, 0, 0, 0, 0],
                                    [0, 0, 2, 2, 0, 0],
                                    [0, 0, 2, 2, 2, 0],
                                    [3, 3, 0, 0, 0, 0],
@@ -2548,7 +2548,7 @@
                                [0, 0, 0, 1, 1, 0]])
         struct = ndimage.generate_binary_structure(2, 2)
         out, n = ndimage.label(data, struct)
-        self.failUnless(diff(out, [[1, 0, 0, 0, 0, 0],
+        self.assertTrue(diff(out, [[1, 0, 0, 0, 0, 0],
                                    [0, 0, 2, 2, 0, 0],
                                    [0, 0, 2, 2, 2, 0],
                                    [2, 2, 0, 0, 0, 0],
@@ -2563,7 +2563,7 @@
                                [0, 0, 0, 0, 0, 0]])
         struct = ndimage.generate_binary_structure(2, 2)
         out, n = ndimage.label(data, struct)
-        self.failUnless(diff(out, [[0, 0, 0, 0, 0, 0],
+        self.assertTrue(diff(out, [[0, 0, 0, 0, 0, 0],
                                    [0, 1, 1, 0, 1, 0],
                                    [0, 1, 1, 1, 1, 0],
                                    [0, 0, 0, 0, 0, 0]]) < eps and n == 1)
@@ -2584,7 +2584,7 @@
                                [3, 3, 0, 0, 0, 0],
                                [3, 3, 0, 0, 0, 0],
                                [0, 0, 0, 4, 4, 0]])
-            self.failUnless(error < eps and n == 4)
+            self.assertTrue(error < eps and n == 4)
 
     def test_label12(self):
         "label 12"
@@ -2600,7 +2600,7 @@
                                [0, 0, 1, 0, 1, 1],
                                [0, 0, 1, 1, 1, 1],
                                [0, 0, 0, 1, 1, 0]])
-            self.failUnless(error < eps and n == 1)
+            self.assertTrue(error < eps and n == 1)
 
     def test_label13(self):
         "label 13"
@@ -2615,43 +2615,43 @@
                                [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1],
                                [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
                                [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
-            self.failUnless(error < eps and n == 1)
+            self.assertTrue(error < eps and n == 1)
 
     def test_find_objects01(self):
         "find_objects 1"
         data = numpy.ones([], dtype=int)
         out = ndimage.find_objects(data)
-        self.failUnless(out == [()])
+        self.assertTrue(out == [()])
 
     def test_find_objects02(self):
         "find_objects 2"
         data = numpy.zeros([], dtype=int)
         out = ndimage.find_objects(data)
-        self.failUnless(out == [])
+        self.assertTrue(out == [])
 
     def test_find_objects03(self):
         "find_objects 3"
         data = numpy.ones([1], dtype=int)
         out = ndimage.find_objects(data)
-        self.failUnless(out == [(slice(0, 1, None),)])
+        self.assertTrue(out == [(slice(0, 1, None),)])
 
     def test_find_objects04(self):
         "find_objects 4"
         data = numpy.zeros([1], dtype=int)
         out = ndimage.find_objects(data)
-        self.failUnless(out == [])
+        self.assertTrue(out == [])
 
     def test_find_objects05(self):
         "find_objects 5"
         data = numpy.ones([5], dtype=int)
         out = ndimage.find_objects(data)
-        self.failUnless(out == [(slice(0, 5, None),)])
+        self.assertTrue(out == [(slice(0, 5, None),)])
 
     def test_find_objects06(self):
         "find_objects 6"
         data = numpy.array([1, 0, 2, 2, 0, 3])
         out = ndimage.find_objects(data)
-        self.failUnless(out == [(slice(0, 1, None),),
+        self.assertTrue(out == [(slice(0, 1, None),),
                                 (slice(2, 4, None),),
                                 (slice(5, 6, None),)])
 
@@ -2664,7 +2664,7 @@
                                [0, 0, 0, 0, 0, 0],
                                [0, 0, 0, 0, 0, 0]])
         out = ndimage.find_objects(data)
-        self.failUnless(out == []),
+        self.assertTrue(out == []),
 
     def test_find_objects08(self):
         "find_objects 8"
@@ -2675,7 +2675,7 @@
                                [3, 3, 0, 0, 0, 0],
                                [0, 0, 0, 4, 4, 0]])
         out = ndimage.find_objects(data)
-        self.failUnless(out == [(slice(0, 1, None), slice(0, 1, None)),
+        self.assertTrue(out == [(slice(0, 1, None), slice(0, 1, None)),
                                 (slice(1, 3, None), slice(2, 5, None)),
                                 (slice(3, 5, None), slice(0, 2, None)),
                                 (slice(5, 6, None), slice(3, 5, None))])
@@ -2689,7 +2689,7 @@
                                [0, 0, 0, 0, 0, 0],
                                [0, 0, 0, 4, 4, 0]])
         out = ndimage.find_objects(data)
-        self.failUnless(out == [(slice(0, 1, None), slice(0, 1, None)),
+        self.assertTrue(out == [(slice(0, 1, None), slice(0, 1, None)),
                                 (slice(1, 3, None), slice(2, 5, None)),
                                 None,
                                 (slice(5, 6, None), slice(3, 5, None))])
@@ -2699,35 +2699,35 @@
         for type in self.types:
             input = numpy.array([], type)
             output = ndimage.sum(input)
-            self.failUnless(output == 0.0)
+            self.assertTrue(output == 0.0)
 
     def test_sum02(self):
         "sum 2"
         for type in self.types:
             input = numpy.zeros([0, 4], type)
             output = ndimage.sum(input)
-            self.failUnless(output == 0.0)
+            self.assertTrue(output == 0.0)
 
     def test_sum03(self):
         "sum 3"
         for type in self.types:
             input = numpy.ones([], type)
             output = ndimage.sum(input)
-            self.failUnless(output == 1.0)
+            self.assertTrue(output == 1.0)
 
     def test_sum04(self):
         "sum 4"
         for type in self.types:
             input = numpy.array([1, 2], type)
             output = ndimage.sum(input)
-            self.failUnless(output == 3.0)
+            self.assertTrue(output == 3.0)
 
     def test_sum05(self):
         "sum 5"
         for type in self.types:
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.sum(input)
-            self.failUnless(output == 10.0)
+            self.assertTrue(output == 10.0)
 
     def test_sum06(self):
         "sum 6"
@@ -2735,7 +2735,7 @@
         for type in self.types:
             input = numpy.array([], type)
             output = ndimage.sum(input, labels = labels)
-            self.failUnless(output == 0.0)
+            self.assertTrue(output == 0.0)
 
     def test_sum07(self):
         "sum 7"
@@ -2743,7 +2743,7 @@
         for type in self.types:
             input = numpy.zeros([0, 4], type)
             output = ndimage.sum(input, labels = labels)
-            self.failUnless(output == 0.0)
+            self.assertTrue(output == 0.0)
 
     def test_sum08(self):
         "sum 8"
@@ -2751,7 +2751,7 @@
         for type in self.types:
             input = numpy.array([1, 2], type)
             output = ndimage.sum(input, labels = labels)
-            self.failUnless(output == 1.0)
+            self.assertTrue(output == 1.0)
 
     def test_sum09(self):
         "sum 9"
@@ -2759,14 +2759,14 @@
         for type in self.types:
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.sum(input, labels = labels)
-            self.failUnless(output == 4.0)
+            self.assertTrue(output == 4.0)
 
     def test_sum10(self):
         "sum 10"
         labels = numpy.array([1, 0], bool)
         input = numpy.array([[1, 2], [3, 4]], bool)
         output = ndimage.sum(input, labels = labels)
-        self.failUnless(output == 2.0)
+        self.assertTrue(output == 2.0)
 
     def test_sum11(self):
         "sum 11"
@@ -2775,7 +2775,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.sum(input, labels = labels,
                                            index = 2)
-            self.failUnless(output == 6.0)
+            self.assertTrue(output == 6.0)
 
     def test_sum12(self):
         "sum 12"
@@ -2784,7 +2784,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.sum(input, labels = labels,
                                             index = [4, 8, 2])
-            self.failUnless(numpy.all(output == [4.0, 0.0, 5.0]))
+            self.assertTrue(numpy.all(output == [4.0, 0.0, 5.0]))
 
     def test_mean01(self):
         "mean 1"
@@ -2792,14 +2792,14 @@
         for type in self.types:
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.mean(input, labels = labels)
-            self.failUnless(output == 2.0)
+            self.assertTrue(output == 2.0)
 
     def test_mean02(self):
         "mean 2"
         labels = numpy.array([1, 0], bool)
         input = numpy.array([[1, 2], [3, 4]], bool)
         output = ndimage.mean(input, labels = labels)
-        self.failUnless(output == 1.0)
+        self.assertTrue(output == 1.0)
 
     def test_mean03(self):
         "mean 3"
@@ -2808,7 +2808,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.mean(input, labels = labels,
                                             index = 2)
-            self.failUnless(output == 3.0)
+            self.assertTrue(output == 3.0)
 
     def test_mean04(self):
         "mean 4"
@@ -2817,7 +2817,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.mean(input, labels = labels,
                                             index = [4, 8, 2])
-            self.failUnless(numpy.all(output[[0,2]] == [4.0, 2.5]) and
+            self.assertTrue(numpy.all(output[[0,2]] == [4.0, 2.5]) and
                             numpy.isnan(output[1]))
 
     def test_minimum01(self):
@@ -2826,14 +2826,14 @@
         for type in self.types:
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.minimum(input, labels = labels)
-            self.failUnless(output == 1.0)
+            self.assertTrue(output == 1.0)
 
     def test_minimum02(self):
         "minimum 2"
         labels = numpy.array([1, 0], bool)
         input = numpy.array([[2, 2], [2, 4]], bool)
         output = ndimage.minimum(input, labels = labels)
-        self.failUnless(output == 1.0)
+        self.assertTrue(output == 1.0)
 
     def test_minimum03(self):
         "minimum 3"
@@ -2842,7 +2842,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.minimum(input, labels = labels,
                                                index = 2)
-            self.failUnless(output == 2.0)
+            self.assertTrue(output == 2.0)
 
     def test_minimum04(self):
         "minimum 4"
@@ -2851,7 +2851,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.minimum(input, labels = labels,
                                                index = [2, 3, 8])
-            self.failUnless(numpy.all(output == [2.0, 4.0, 0.0]))
+            self.assertTrue(numpy.all(output == [2.0, 4.0, 0.0]))
 
     def test_maximum01(self):
         "maximum 1"
@@ -2859,14 +2859,14 @@
         for type in self.types:
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.maximum(input, labels = labels)
-            self.failUnless(output == 3.0)
+            self.assertTrue(output == 3.0)
 
     def test_maximum02(self):
         "maximum 2"
         labels = numpy.array([1, 0], bool)
         input = numpy.array([[2, 2], [2, 4]], bool)
         output = ndimage.maximum(input, labels = labels)
-        self.failUnless(output == 1.0)
+        self.assertTrue(output == 1.0)
 
     def test_maximum03(self):
         "maximum 3"
@@ -2875,7 +2875,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.maximum(input, labels = labels,
                                                index = 2)
-            self.failUnless(output == 4.0)
+            self.assertTrue(output == 4.0)
 
     def test_maximum04(self):
         "maximum 4"
@@ -2884,7 +2884,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.maximum(input, labels = labels,
                                                index = [2, 3, 8])
-            self.failUnless(numpy.all(output == [3.0, 4.0, 0.0]))
+            self.assertTrue(numpy.all(output == [3.0, 4.0, 0.0]))
 
     def test_maximum05(self):
         "Ticket #501"
@@ -2896,27 +2896,27 @@
         for type in self.types:
             input = numpy.array([], type)
             output = ndimage.variance(input)
-            self.failUnless(numpy.isnan(output))
+            self.assertTrue(numpy.isnan(output))
 
     def test_variance02(self):
         "variance 2"
         for type in self.types:
             input = numpy.array([1], type)
             output = ndimage.variance(input)
-            self.failUnless(float(output) == 0.0)
+            self.assertTrue(float(output) == 0.0)
 
     def test_variance03(self):
         "variance 3"
         for type in self.types:
             input = numpy.array([1, 3], type)
             output = ndimage.variance(input)
-            self.failUnless(output == 1.0)
+            self.assertTrue(output == 1.0)
 
     def test_variance04(self):
         "variance 4"
         input = numpy.array([1, 0], bool)
         output = ndimage.variance(input)
-        self.failUnless(output == 0.25)
+        self.assertTrue(output == 0.25)
 
     def test_variance05(self):
         "variance 5"
@@ -2924,7 +2924,7 @@
         for type in self.types:
             input = numpy.array([1, 3, 8], type)
             output = ndimage.variance(input, labels, 2)
-            self.failUnless(output == 1.0)
+            self.assertTrue(output == 1.0)
 
     def test_variance06(self):
         "variance 6"
@@ -2932,34 +2932,34 @@
         for type in self.types:
             input = numpy.array([1, 3, 8, 10, 8], type)
             output = ndimage.variance(input, labels, [2, 3, 4])
-            self.failUnless(numpy.all(output == [1.0, 1.0, 0.0]))
+            self.assertTrue(numpy.all(output == [1.0, 1.0, 0.0]))
 
     def test_standard_deviation01(self):
         "standard deviation 1"
         for type in self.types:
             input = numpy.array([], type)
             output = ndimage.standard_deviation(input)
-            self.failUnless(numpy.isnan(output))
+            self.assertTrue(numpy.isnan(output))
 
     def test_standard_deviation02(self):
         "standard deviation 2"
         for type in self.types:
             input = numpy.array([1], type)
             output = ndimage.standard_deviation(input)
-            self.failUnless(float(output) == 0.0)
+            self.assertTrue(float(output) == 0.0)
 
     def test_standard_deviation03(self):
         "standard deviation 3"
         for type in self.types:
             input = numpy.array([1, 3], type)
             output = ndimage.standard_deviation(input)
-            self.failUnless(output == math.sqrt(1.0))
+            self.assertTrue(output == math.sqrt(1.0))
 
     def test_standard_deviation04(self):
         "standard deviation 4"
         input = numpy.array([1, 0], bool)
         output = ndimage.standard_deviation(input)
-        self.failUnless(output == 0.5)
+        self.assertTrue(output == 0.5)
 
     def test_standard_deviation05(self):
         "standard deviation 5"
@@ -2967,7 +2967,7 @@
         for type in self.types:
             input = numpy.array([1, 3, 8], type)
             output = ndimage.standard_deviation(input, labels, 2)
-            self.failUnless(output == 1.0)
+            self.assertTrue(output == 1.0)
 
     def test_standard_deviation06(self):
         "standard deviation 6"
@@ -2976,7 +2976,7 @@
             input = numpy.array([1, 3, 8, 10, 8], type)
             output = ndimage.standard_deviation(input, labels,
                                                           [2, 3, 4])
-            self.failUnless(np.all(output == [1.0, 1.0, 0.0]))
+            self.assertTrue(np.all(output == [1.0, 1.0, 0.0]))
 
     def test_minimum_position01(self):
         "minimum position 1"
@@ -2985,7 +2985,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.minimum_position(input,
                                                         labels = labels)
-            self.failUnless(output == (0, 0))
+            self.assertTrue(output == (0, 0))
 
     def test_minimum_position02(self):
         "minimum position 2"
@@ -2994,7 +2994,7 @@
                                     [3, 7, 0, 2],
                                     [1, 5, 1, 1]], type)
             output = ndimage.minimum_position(input)
-            self.failUnless(output == (1, 2))
+            self.assertTrue(output == (1, 2))
 
     def test_minimum_position03(self):
         "minimum position 3"
@@ -3002,7 +3002,7 @@
                                 [3, 7, 0, 2],
                                 [1, 5, 1, 1]], bool)
         output = ndimage.minimum_position(input)
-        self.failUnless(output == (1, 2))
+        self.assertTrue(output == (1, 2))
 
     def test_minimum_position04(self):
         "minimum position 4"
@@ -3010,7 +3010,7 @@
                                 [3, 7, 1, 2],
                                 [1, 5, 1, 1]], bool)
         output = ndimage.minimum_position(input)
-        self.failUnless(output == (0, 0))
+        self.assertTrue(output == (0, 0))
 
     def test_minimum_position05(self):
         "minimum position 5"
@@ -3020,7 +3020,7 @@
                                     [3, 7, 0, 2],
                                     [1, 5, 2, 3]], type)
             output = ndimage.minimum_position(input, labels)
-            self.failUnless(output == (2, 0))
+            self.assertTrue(output == (2, 0))
 
     def test_minimum_position06(self):
         "minimum position 6"
@@ -3030,7 +3030,7 @@
                                     [3, 7, 0, 2],
                                     [1, 5, 1, 1]], type)
             output = ndimage.minimum_position(input, labels, 2)
-            self.failUnless(output == (0, 1))
+            self.assertTrue(output == (0, 1))
 
     def test_minimum_position07(self):
         "minimum position 7"
@@ -3041,7 +3041,7 @@
                                     [1, 5, 1, 1]], type)
             output = ndimage.minimum_position(input, labels,
                                                         [2, 3])
-            self.failUnless(output[0] == (0, 1) and output[1] == (1, 2))
+            self.assertTrue(output[0] == (0, 1) and output[1] == (1, 2))
 
     def test_maximum_position01(self):
         "maximum position 1"
@@ -3050,7 +3050,7 @@
             input = numpy.array([[1, 2], [3, 4]], type)
             output = ndimage.maximum_position(input,
                                                         labels = labels)
-            self.failUnless(output == (1, 0))
+            self.assertTrue(output == (1, 0))
 
     def test_maximum_position02(self):
         "maximum position 2"
@@ -3059,7 +3059,7 @@
                                     [3, 7, 8, 2],
                                     [1, 5, 1, 1]], type)
             output = ndimage.maximum_position(input)
-            self.failUnless(output == (1, 2))
+            self.assertTrue(output == (1, 2))
 
     def test_maximum_position03(self):
         "maximum position 3"
@@ -3067,7 +3067,7 @@
                                 [3, 7, 8, 2],
                                 [1, 5, 1, 1]], bool)
         output = ndimage.maximum_position(input)
-        self.failUnless(output == (0, 0))
+        self.assertTrue(output == (0, 0))
 
     def test_maximum_position04(self):
         "maximum position 4"
@@ -3077,7 +3077,7 @@
                                     [3, 7, 8, 2],
                                     [1, 5, 1, 1]], type)
             output = ndimage.maximum_position(input, labels)
-            self.failUnless(output == (1, 1))
+            self.assertTrue(output == (1, 1))
 
     def test_maximum_position05(self):
         "maximum position 5"
@@ -3087,7 +3087,7 @@
                                     [3, 7, 8, 2],
                                     [1, 5, 1, 1]], type)
             output = ndimage.maximum_position(input, labels, 1)
-            self.failUnless(output == (0, 0))
+            self.assertTrue(output == (0, 0))
 
     def test_maximum_position06(self):
         "maximum position 6"
@@ -3098,7 +3098,7 @@
                                     [1, 5, 1, 1]], type)
             output = ndimage.maximum_position(input, labels,
                                                         [1, 2])
-            self.failUnless(output[0] == (0, 0) and output[1] == (1, 1))
+            self.assertTrue(output[0] == (0, 0) and output[1] == (1, 1))
 
     def test_extrema01(self):
         "extrema 1"
@@ -3112,7 +3112,7 @@
                                                          labels = labels)
             output5 = ndimage.maximum_position(input,
                                                          labels = labels)
-            self.failUnless(output1 == (output2, output3, output4,
+            self.assertTrue(output1 == (output2, output3, output4,
                                         output5))
 
     def test_extrema02(self):
@@ -3130,7 +3130,7 @@
                                                 labels = labels, index = 2)
             output5 = ndimage.maximum_position(input,
                                                 labels = labels, index = 2)
-            self.failUnless(output1 == (output2, output3, output4,
+            self.assertTrue(output1 == (output2, output3, output4,
                                         output5))
 
     def test_extrema03(self):
@@ -3148,10 +3148,10 @@
                                         labels = labels, index = [2, 3, 8])
             output5 = ndimage.maximum_position(input,
                                         labels = labels, index = [2, 3, 8])
-            self.failUnless(numpy.all(output1[0] == output2))
-            self.failUnless(numpy.all(output1[1] == output3))
-            self.failUnless(numpy.all(output1[2]  == output4))
-            self.failUnless(numpy.all(output1[3]  == output5))
+            self.assertTrue(numpy.all(output1[0] == output2))
+            self.assertTrue(numpy.all(output1[1] == output3))
+            self.assertTrue(numpy.all(output1[2]  == output4))
+            self.assertTrue(numpy.all(output1[3]  == output5))
 
     def test_extrema04(self):
         "extrema 4"
@@ -3167,10 +3167,10 @@
                                                          [1, 2])
             output5 = ndimage.maximum_position(input, labels,
                                                          [1, 2])
-            self.failUnless(numpy.all(output1[0] == output2))
-            self.failUnless(numpy.all(output1[1] == output3))
-            self.failUnless(numpy.all(output1[2] == output4))
-            self.failUnless(numpy.all(output1[3] == output5))
+            self.assertTrue(numpy.all(output1[0] == output2))
+            self.assertTrue(numpy.all(output1[1] == output3))
+            self.assertTrue(numpy.all(output1[2] == output4))
+            self.assertTrue(numpy.all(output1[3] == output5))
 
     def test_center_of_mass01(self):
         "center of mass 1"
@@ -3179,7 +3179,7 @@
             input = numpy.array([[1, 0], [0, 0]], type)
             output = ndimage.center_of_mass(input)
             e = diff(true, output)
-            self.failUnless(e < eps)
+            self.assertTrue(e < eps)
 
     def test_center_of_mass02(self):
         "center of mass 2"
@@ -3188,7 +3188,7 @@
             input = numpy.array([[0, 0], [1, 0]], type)
             output = ndimage.center_of_mass(input)
             e = diff(true, output)
-            self.failUnless(e < eps)
+            self.assertTrue(e < eps)
 
     def test_center_of_mass03(self):
         "center of mass 3"
@@ -3197,7 +3197,7 @@
             input = numpy.array([[0, 1], [0, 0]], type)
             output = ndimage.center_of_mass(input)
             e = diff(true, output)
-            self.failUnless(e < eps)
+            self.assertTrue(e < eps)
 
     def test_center_of_mass04(self):
         "center of mass 4"
@@ -3206,7 +3206,7 @@
             input = numpy.array([[0, 0], [0, 1]], type)
             output = ndimage.center_of_mass(input)
             e = diff(true, output)
-            self.failUnless(e < eps)
+            self.assertTrue(e < eps)
 
     def test_center_of_mass05(self):
         "center of mass 5"
@@ -3215,7 +3215,7 @@
             input = numpy.array([[1, 1], [1, 1]], type)
             output = ndimage.center_of_mass(input)
             e = diff(true, output)
-            self.failUnless(e < eps)
+            self.assertTrue(e < eps)
 
     def test_center_of_mass06(self):
         "center of mass 6"
@@ -3223,7 +3223,7 @@
         input = numpy.array([[1, 2], [3, 1]], bool)
         output = ndimage.center_of_mass(input)
         e = diff(true, output)
-        self.failUnless(e < eps)
+        self.assertTrue(e < eps)
 
     def test_center_of_mass07(self):
         "center of mass 7"
@@ -3232,7 +3232,7 @@
         input = numpy.array([[1, 2], [3, 1]], bool)
         output = ndimage.center_of_mass(input, labels)
         e = diff(true, output)
-        self.failUnless(e < eps)
+        self.assertTrue(e < eps)
 
     def test_center_of_mass08(self):
         "center of mass 8"
@@ -3241,7 +3241,7 @@
         input = numpy.array([[5, 2], [3, 1]], bool)
         output = ndimage.center_of_mass(input, labels, 2)
         e = diff(true, output)
-        self.failUnless(e < eps)
+        self.assertTrue(e < eps)
 
 
     def test_center_of_mass09(self):
@@ -3251,7 +3251,7 @@
         input = numpy.array([[1, 2], [1, 1]], bool)
         output = ndimage.center_of_mass(input, labels, [1, 2])
         e = diff(true, output)
-        self.failUnless(e < eps)
+        self.assertTrue(e < eps)
 
     def test_histogram01(self):
         "histogram 1"
@@ -3259,7 +3259,7 @@
         input = numpy.arange(10)
         output = ndimage.histogram(input, 0, 10, 10)
         e = diff(true, output)
-        self.failUnless(e < eps)
+        self.assertTrue(e < eps)
 
     def test_histogram02(self):
         "histogram 2"
@@ -3268,7 +3268,7 @@
         input = numpy.array([1, 1, 3, 4, 3, 3, 3, 3])
         output = ndimage.histogram(input, 0, 4, 5, labels, 1)
         e = diff(true, output)
-        self.failUnless(e < eps)
+        self.assertTrue(e < eps)
 
     def test_histogram03(self):
         "histogram 3"
@@ -3279,7 +3279,7 @@
         output = ndimage.histogram(input, 0, 4, 5, labels, (1,2))
         e1 = diff(true1, output[0])
         e2 = diff(true2, output[1])
-        self.failUnless(e1 < eps and e2 < eps)
+        self.assertTrue(e1 < eps and e2 < eps)
 
     def test_distance_transform_bf01(self):
         "brute force distance transform 1"
@@ -3323,7 +3323,7 @@
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft)
-        self.failUnless(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
 
     def test_distance_transform_bf02(self):
         "brute force distance transform 2"
@@ -3366,7 +3366,7 @@
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft)
-        self.failUnless(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
 
     def test_distance_transform_bf03(self):
         "brute force distance transform 3"
@@ -3409,7 +3409,7 @@
                         [0, 1, 2, 4, 5, 6, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft)
-        self.failUnless(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
 
     def test_distance_transform_bf04(self):
         "brute force distance transform 4"
@@ -3458,9 +3458,9 @@
         dts.append(dt)
         fts.append(ft)
         for dt in dts:
-            self.failUnless(diff(tdt, dt) < eps)
+            self.assertTrue(diff(tdt, dt) < eps)
         for ft in fts:
-            self.failUnless(diff(tft, ft) < eps)
+            self.assertTrue(diff(tft, ft) < eps)
 
     def test_distance_transform_bf05(self):
         "brute force distance transform 5"
@@ -3503,7 +3503,7 @@
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft)
-        self.failUnless(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
 
     def test_distance_transform_bf06(self):
         "brute force distance transform 6"
@@ -3546,8 +3546,8 @@
                         [0, 1, 2, 2, 4, 6, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft)
-        self.failUnless(error1 < eps and error2 < eps)
-        self.failUnless(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
 
     def test_distance_transform_cdt01(self):
         "chamfer type distance transform 1"
@@ -3583,7 +3583,7 @@
                         [0, 1, 2, 2, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],]], ft)
-        self.failUnless(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
 
     def test_distance_transform_cdt02(self):
         "chamfer type distance transform 2"
@@ -3619,7 +3619,7 @@
                         [0, 1, 2, 2, 5, 6, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],
                         [0, 1, 2, 3, 4, 5, 6, 7, 8],]], ft)
-        self.failUnless(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
 
     def test_distance_transform_cdt03(self):
         "chamfer type distance transform 3"
@@ -3668,9 +3668,9 @@
         dts.append(dt)
         fts.append(ft)
         for dt in dts:
-            self.failUnless(diff(tdt, dt) < eps)
+            self.assertTrue(diff(tdt, dt) < eps)
         for ft in fts:
-            self.failUnless(diff(tft, ft) < eps)
+            self.assertTrue(diff(tft, ft) < eps)
 
     def test_distance_transform_edt01(self):
         "euclidean distance transform 1"
@@ -3695,7 +3695,7 @@
         dt = numpy.add.reduce(dt, axis = 0)
         numpy.sqrt(dt, dt)
         error2 = diff(bf, dt)
-        self.failUnless(error1 < eps and error2 < eps)
+        self.assertTrue(error1 < eps and error2 < eps)
 
     def test_distance_transform_edt02(self):
         "euclidean distance transform 2"
@@ -3744,9 +3744,9 @@
         dts.append(dt)
         fts.append(ft)
         for dt in dts:
-            self.failUnless(diff(tdt, dt) < eps)
+            self.assertTrue(diff(tdt, dt) < eps)
         for ft in fts:
-            self.failUnless(diff(tft, ft) < eps)
+            self.assertTrue(diff(tft, ft) < eps)
 
     def test_distance_transform_edt03(self):
         "euclidean distance transform 3"
@@ -3764,7 +3764,7 @@
                                                       sampling = [2, 2])
         out = ndimage.distance_transform_edt(data,
                                                        sampling = [2, 2])
-        self.failUnless(diff(ref, out) < eps)
+        self.assertTrue(diff(ref, out) < eps)
 
 
     def test_distance_transform_edt4(self):
@@ -3783,29 +3783,29 @@
                                                       sampling = [2, 1])
         out = ndimage.distance_transform_edt(data,
                                                        sampling = [2, 1])
-        self.failUnless(diff(ref, out) < eps)
+        self.assertTrue(diff(ref, out) < eps)
 
     def test_generate_structure01(self):
         "generation of a binary structure 1"
         struct = ndimage.generate_binary_structure(0, 1)
-        self.failUnless(diff(struct, 1) < eps)
+        self.assertTrue(diff(struct, 1) < eps)
 
     def test_generate_structure02(self):
         "generation of a binary structure 2"
         struct = ndimage.generate_binary_structure(1, 1)
-        self.failUnless(diff(struct, [1, 1, 1]) < eps)
+        self.assertTrue(diff(struct, [1, 1, 1]) < eps)
 
     def test_generate_structure03(self):
         "generation of a binary structure 3"
         struct = ndimage.generate_binary_structure(2, 1)
-        self.failUnless(diff(struct, [[0, 1, 0],
+        self.assertTrue(diff(struct, [[0, 1, 0],
                                       [1, 1, 1],
                                       [0, 1, 0]]) < eps)
 
     def test_generate_structure04(self):
         "generation of a binary structure 4"
         struct = ndimage.generate_binary_structure(2, 2)
-        self.failUnless(diff(struct, [[1, 1, 1],
+        self.assertTrue(diff(struct, [[1, 1, 1],
                                       [1, 1, 1],
                                       [1, 1, 1]]) < eps)
 
@@ -3815,7 +3815,7 @@
                   [1, 1, 1],
                   [0, 1, 0]]
         out = ndimage.iterate_structure(struct, 2)
-        self.failUnless(diff(out, [[0, 0, 1, 0, 0],
+        self.assertTrue(diff(out, [[0, 0, 1, 0, 0],
                                    [0, 1, 1, 1, 0],
                                    [1, 1, 1, 1, 1],
                                    [0, 1, 1, 1, 0],
@@ -3827,7 +3827,7 @@
                   [1, 1],
                   [0, 1]]
         out = ndimage.iterate_structure(struct, 2)
-        self.failUnless(diff(out, [[0, 0, 1],
+        self.assertTrue(diff(out, [[0, 0, 1],
                                    [0, 1, 1],
                                    [1, 1, 1],
                                    [0, 1, 1],
@@ -3844,63 +3844,63 @@
                               [1, 1, 1, 1, 1],
                               [0, 1, 1, 1, 0],
                               [0, 0, 1, 0, 0]])
-        self.failUnless(error < eps and out[1] == [2, 2])
+        self.assertTrue(error < eps and out[1] == [2, 2])
 
     def test_binary_erosion01(self):
         "binary erosion 1"
         for type in self.types:
             data = numpy.ones([], type)
             out = ndimage.binary_erosion(data)
-            self.failUnless(diff(out, 1) < eps)
+            self.assertTrue(diff(out, 1) < eps)
 
     def test_binary_erosion02(self):
         "binary erosion 2"
         for type in self.types:
             data = numpy.ones([], type)
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, 1) < eps)
+            self.assertTrue(diff(out, 1) < eps)
 
     def test_binary_erosion03(self):
         "binary erosion 3"
         for type in self.types:
             data = numpy.ones([1], type)
             out = ndimage.binary_erosion(data)
-            self.failUnless(diff(out, [0]) < eps)
+            self.assertTrue(diff(out, [0]) < eps)
 
     def test_binary_erosion04(self):
         "binary erosion 4"
         for type in self.types:
             data = numpy.ones([1], type)
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, [1]) < eps)
+            self.assertTrue(diff(out, [1]) < eps)
 
     def test_binary_erosion05(self):
         "binary erosion 5"
         for type in self.types:
             data = numpy.ones([3], type)
             out = ndimage.binary_erosion(data)
-            self.failUnless(diff(out, [0, 1, 0]) < eps)
+            self.assertTrue(diff(out, [0, 1, 0]) < eps)
 
     def test_binary_erosion06(self):
         "binary erosion 6"
         for type in self.types:
             data = numpy.ones([3], type)
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, [1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1]) < eps)
 
     def test_binary_erosion07(self):
         "binary erosion 7"
         for type in self.types:
             data = numpy.ones([5], type)
             out = ndimage.binary_erosion(data)
-            self.failUnless(diff(out, [0, 1, 1, 1, 0]) < eps)
+            self.assertTrue(diff(out, [0, 1, 1, 1, 0]) < eps)
 
     def test_binary_erosion08(self):
         "binary erosion 8"
         for type in self.types:
             data = numpy.ones([5], type)
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, [1, 1, 1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1, 1, 1]) < eps)
 
     def test_binary_erosion09(self):
         "binary erosion 9"
@@ -3908,7 +3908,7 @@
             data = numpy.ones([5], type)
             data[2] = 0
             out = ndimage.binary_erosion(data)
-            self.failUnless(diff(out, [0, 0, 0, 0, 0]) < eps)
+            self.assertTrue(diff(out, [0, 0, 0, 0, 0]) < eps)
 
     def test_binary_erosion10(self):
         "binary erosion 10"
@@ -3916,7 +3916,7 @@
             data = numpy.ones([5], type)
             data[2] = 0
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, [1, 0, 0, 0, 1]) < eps)
+            self.assertTrue(diff(out, [1, 0, 0, 0, 1]) < eps)
 
     def test_binary_erosion11(self):
         "binary erosion 11"
@@ -3926,7 +3926,7 @@
             struct = [1, 0, 1]
             out = ndimage.binary_erosion(data, struct,
                                                    border_value = 1)
-            self.failUnless(diff(out, [1, 0, 1, 0, 1]) < eps)
+            self.assertTrue(diff(out, [1, 0, 1, 0, 1]) < eps)
 
     def test_binary_erosion12(self):
         "binary erosion 12"
@@ -3937,7 +3937,7 @@
             out = ndimage.binary_erosion(data, struct,
                                                    border_value = 1,
                                                    origin = -1)
-            self.failUnless(diff(out, [0, 1, 0, 1, 1]) < eps)
+            self.assertTrue(diff(out, [0, 1, 0, 1, 1]) < eps)
 
     def test_binary_erosion13(self):
         "binary erosion 13"
@@ -3948,7 +3948,7 @@
             out = ndimage.binary_erosion(data, struct,
                                                    border_value = 1,
                                                    origin = 1)
-            self.failUnless(diff(out, [1, 1, 0, 1, 0]) < eps)
+            self.assertTrue(diff(out, [1, 1, 0, 1, 0]) < eps)
 
     def test_binary_erosion14(self):
         "binary erosion 14"
@@ -3958,7 +3958,7 @@
             struct = [1, 1]
             out = ndimage.binary_erosion(data, struct,
                                                    border_value = 1)
-            self.failUnless(diff(out, [1, 1, 0, 0, 1]) < eps)
+            self.assertTrue(diff(out, [1, 1, 0, 0, 1]) < eps)
 
     def test_binary_erosion15(self):
         "binary erosion 15"
@@ -3969,42 +3969,42 @@
             out = ndimage.binary_erosion(data, struct,
                                                    border_value = 1,
                                                    origin = -1)
-            self.failUnless(diff(out, [1, 0, 0, 1, 1]) < eps)
+            self.assertTrue(diff(out, [1, 0, 0, 1, 1]) < eps)
 
     def test_binary_erosion16(self):
         "binary erosion 16"
         for type in self.types:
             data = numpy.ones([1, 1], type)
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, [[1]]) < eps)
+            self.assertTrue(diff(out, [[1]]) < eps)
 
     def test_binary_erosion17(self):
         "binary erosion 17"
         for type in self.types:
             data = numpy.ones([1, 1], type)
             out = ndimage.binary_erosion(data)
-            self.failUnless(diff(out, [[0]]) < eps)
+            self.assertTrue(diff(out, [[0]]) < eps)
 
     def test_binary_erosion18(self):
         "binary erosion 18"
         for type in self.types:
             data = numpy.ones([1, 3], type)
             out = ndimage.binary_erosion(data)
-            self.failUnless(diff(out, [[0, 0, 0]]) < eps)
+            self.assertTrue(diff(out, [[0, 0, 0]]) < eps)
 
     def test_binary_erosion19(self):
         "binary erosion 19"
         for type in self.types:
             data = numpy.ones([1, 3], type)
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, [[1, 1, 1]]) < eps)
+            self.assertTrue(diff(out, [[1, 1, 1]]) < eps)
 
     def test_binary_erosion20(self):
         "binary erosion 20"
         for type in self.types:
             data = numpy.ones([3, 3], type)
             out = ndimage.binary_erosion(data)
-            self.failUnless(diff(out, [[0, 0, 0],
+            self.assertTrue(diff(out, [[0, 0, 0],
                                        [0, 1, 0],
                                        [0, 0, 0]]) < eps)
 
@@ -4013,7 +4013,7 @@
         for type in self.types:
             data = numpy.ones([3, 3], type)
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, [[1, 1, 1],
+            self.assertTrue(diff(out, [[1, 1, 1],
                                        [1, 1, 1],
                                        [1, 1, 1]]) < eps)
 
@@ -4037,7 +4037,7 @@
                                    [0, 1, 1, 0, 0, 1, 1, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_erosion(data, border_value = 1)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion23(self):
         "binary erosion 23"
@@ -4061,7 +4061,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_erosion(data, struct,
                                                    border_value = 1)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion24(self):
         "binary erosion 24"
@@ -4086,7 +4086,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_erosion(data, struct,
                                                    border_value = 1)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion25(self):
         "binary erosion 25"
@@ -4112,7 +4112,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_erosion(data, struct,
                                                    border_value = 1)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion26(self):
         "binary erosion 26"
@@ -4138,7 +4138,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_erosion(data, struct,
                                       border_value = 1, origin = (-1, -1))
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion27(self):
         "binary erosion 27"
@@ -4161,7 +4161,7 @@
                                [0, 0, 0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_erosion(data, struct,
                                          border_value = 1, iterations = 2)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion28(self):
         "binary erosion 28"
@@ -4185,7 +4185,7 @@
         out = numpy.zeros(data.shape, bool)
         ndimage.binary_erosion(data, struct, border_value = 1,
                                          iterations = 2, output = out)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion29(self):
         "binary erosion 29"
@@ -4208,7 +4208,7 @@
                                [0, 0, 0, 1, 0, 0, 0]], bool)
         out = ndimage.binary_erosion(data, struct,
                                          border_value = 1, iterations = 3)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion30(self):
         "binary erosion 30"
@@ -4232,7 +4232,7 @@
         out = numpy.zeros(data.shape, bool)
         ndimage.binary_erosion(data, struct, border_value = 1,
                                          iterations = 3, output = out)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion31(self):
         "binary erosion 31"
@@ -4256,7 +4256,7 @@
         out = numpy.zeros(data.shape, bool)
         ndimage.binary_erosion(data, struct, border_value = 1,
                           iterations = 1, output = out, origin = (-1, -1))
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion32(self):
         "binary erosion 32"
@@ -4279,7 +4279,7 @@
                                [0, 0, 0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_erosion(data, struct,
                                          border_value = 1, iterations = 2)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion33(self):
         "binary erosion 33"
@@ -4309,7 +4309,7 @@
                                [0, 0, 0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_erosion(data, struct,
                             border_value = 1, mask = mask, iterations = -1)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion34(self):
         "binary erosion 34"
@@ -4339,7 +4339,7 @@
                                [0, 0, 0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_erosion(data, struct,
                                             border_value = 1, mask = mask)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion35(self):
         "binary erosion 35"
@@ -4374,7 +4374,7 @@
         ndimage.binary_erosion(data, struct, border_value = 1,
                                          iterations = 1, output = out,
                                          origin = (-1, -1), mask = mask)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_erosion36(self):
         "binary erosion 36"
@@ -4410,49 +4410,49 @@
         true = numpy.logical_or(true, tmp)
         out = ndimage.binary_erosion(data, struct, mask = mask,
                                        border_value = 1, origin = (-1, -1))
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation01(self):
         "binary dilation 1"
         for type in self.types:
             data = numpy.ones([], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, 1) < eps)
+            self.assertTrue(diff(out, 1) < eps)
 
     def test_binary_dilation02(self):
         "binary dilation 2"
         for type in self.types:
             data = numpy.zeros([], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, 0) < eps)
+            self.assertTrue(diff(out, 0) < eps)
 
     def test_binary_dilation03(self):
         "binary dilation 3"
         for type in self.types:
             data = numpy.ones([1], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [1]) < eps)
+            self.assertTrue(diff(out, [1]) < eps)
 
     def test_binary_dilation04(self):
         "binary dilation 4"
         for type in self.types:
             data = numpy.zeros([1], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [0]) < eps)
+            self.assertTrue(diff(out, [0]) < eps)
 
     def test_binary_dilation05(self):
         "binary dilation 5"
         for type in self.types:
             data = numpy.ones([3], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1]) < eps)
 
     def test_binary_dilation06(self):
         "binary dilation 6"
         for type in self.types:
             data = numpy.zeros([3], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [0, 0, 0]) < eps)
+            self.assertTrue(diff(out, [0, 0, 0]) < eps)
 
     def test_binary_dilation07(self):
         "binary dilation 7"
@@ -4461,7 +4461,7 @@
             data = numpy.zeros([3], type)
             data[1] = 1
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1]) < eps)
 
     def test_binary_dilation08(self):
         "binary dilation 8"
@@ -4470,7 +4470,7 @@
             data[1] = 1
             data[3] = 1
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [1, 1, 1, 1, 1]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1, 1, 1]) < eps)
 
     def test_binary_dilation09(self):
         "binary dilation 9"
@@ -4478,7 +4478,7 @@
             data = numpy.zeros([5], type)
             data[1] = 1
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [1, 1, 1, 0, 0]) < eps)
+            self.assertTrue(diff(out, [1, 1, 1, 0, 0]) < eps)
 
     def test_binary_dilation10(self):
         "binary dilation 10"
@@ -4486,7 +4486,7 @@
             data = numpy.zeros([5], type)
             data[1] = 1
             out = ndimage.binary_dilation(data, origin = -1)
-            self.failUnless(diff(out, [0, 1, 1, 1, 0]) < eps)
+            self.assertTrue(diff(out, [0, 1, 1, 1, 0]) < eps)
 
     def test_binary_dilation11(self):
         "binary dilation 11"
@@ -4494,7 +4494,7 @@
             data = numpy.zeros([5], type)
             data[1] = 1
             out = ndimage.binary_dilation(data, origin = 1)
-            self.failUnless(diff(out, [1, 1, 0, 0, 0]) < eps)
+            self.assertTrue(diff(out, [1, 1, 0, 0, 0]) < eps)
 
     def test_binary_dilation12(self):
         "binary dilation 12"
@@ -4503,7 +4503,7 @@
             data[1] = 1
             struct = [1, 0, 1]
             out = ndimage.binary_dilation(data, struct)
-            self.failUnless(diff(out, [1, 0, 1, 0, 0]) < eps)
+            self.assertTrue(diff(out, [1, 0, 1, 0, 0]) < eps)
 
     def test_binary_dilation13(self):
         "binary dilation 13"
@@ -4513,7 +4513,7 @@
             struct = [1, 0, 1]
             out = ndimage.binary_dilation(data, struct,
                                                     border_value = 1)
-            self.failUnless(diff(out, [1, 0, 1, 0, 1]) < eps)
+            self.assertTrue(diff(out, [1, 0, 1, 0, 1]) < eps)
 
     def test_binary_dilation14(self):
         "binary dilation 14"
@@ -4523,7 +4523,7 @@
             struct = [1, 0, 1]
             out = ndimage.binary_dilation(data, struct,
                                                     origin = -1)
-            self.failUnless(diff(out, [0, 1, 0, 1, 0]) < eps)
+            self.assertTrue(diff(out, [0, 1, 0, 1, 0]) < eps)
 
     def test_binary_dilation15(self):
         "binary dilation 15"
@@ -4533,35 +4533,35 @@
             struct = [1, 0, 1]
             out = ndimage.binary_dilation(data, struct,
                                             origin = -1, border_value = 1)
-            self.failUnless(diff(out, [1, 1, 0, 1, 0]) < eps)
+            self.assertTrue(diff(out, [1, 1, 0, 1, 0]) < eps)
 
     def test_binary_dilation16(self):
         "binary dilation 16"
         for type in self.types:
             data = numpy.ones([1, 1], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [[1]]) < eps)
+            self.assertTrue(diff(out, [[1]]) < eps)
 
     def test_binary_dilation17(self):
         "binary dilation 17"
         for type in self.types:
             data = numpy.zeros([1, 1], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [[0]]) < eps)
+            self.assertTrue(diff(out, [[0]]) < eps)
 
     def test_binary_dilation18(self):
         "binary dilation 18"
         for type in self.types:
             data = numpy.ones([1, 3], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [[1, 1, 1]]) < eps)
+            self.assertTrue(diff(out, [[1, 1, 1]]) < eps)
 
     def test_binary_dilation19(self):
         "binary dilation 19"
         for type in self.types:
             data = numpy.ones([3, 3], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [[1, 1, 1],
+            self.assertTrue(diff(out, [[1, 1, 1],
                                [1, 1, 1],
                                [1, 1, 1]]) < eps)
 
@@ -4571,7 +4571,7 @@
             data = numpy.zeros([3, 3], type)
             data[1, 1] = 1
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, [[0, 1, 0],
+            self.assertTrue(diff(out, [[0, 1, 0],
                                        [1, 1, 1],
                                        [0, 1, 0]]) < eps)
 
@@ -4582,7 +4582,7 @@
             data = numpy.zeros([3, 3], type)
             data[1, 1] = 1
             out = ndimage.binary_dilation(data, struct)
-            self.failUnless(diff(out, [[1, 1, 1],
+            self.assertTrue(diff(out, [[1, 1, 1],
                                        [1, 1, 1],
                                        [1, 1, 1]]) < eps)
 
@@ -4607,7 +4607,7 @@
                                            [0, 0, 0, 0, 0, 0, 0, 0],
                                            [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_dilation(data)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation23(self):
         "binary dilation 23"
@@ -4630,7 +4630,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_dilation(data, border_value = 1)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation24(self):
         "binary dilation 24"
@@ -4653,7 +4653,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_dilation(data, origin = (1, 1))
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation25(self):
         "binary dilation 25"
@@ -4677,7 +4677,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_dilation(data, origin = (1, 1),
                                                          border_value = 1)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation26(self):
         "binary dilation 26"
@@ -4701,7 +4701,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_dilation(data, struct)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation27(self):
         "binary dilation 27"
@@ -4726,7 +4726,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_dilation(data, struct)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation28(self):
         "binary dilation 28"
@@ -4741,7 +4741,7 @@
                                    [0, 0, 0, 0],
                                    [0, 0, 0, 0]], type)
             out = ndimage.binary_dilation(data, border_value = 1)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation29(self):
         "binary dilation 29"
@@ -4760,7 +4760,7 @@
                                [0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_dilation(data, struct,
                                                 iterations = 2)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation30(self):
         "binary dilation 30"
@@ -4780,7 +4780,7 @@
         out = numpy.zeros(data.shape, bool)
         ndimage.binary_dilation(data, struct, iterations = 2,
                                           output = out)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation31(self):
         "binary dilation 31"
@@ -4799,7 +4799,7 @@
                                [0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_dilation(data, struct,
                                                 iterations = 3)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation32(self):
         "binary dilation 32"
@@ -4819,7 +4819,7 @@
         out = numpy.zeros(data.shape, bool)
         ndimage.binary_dilation(data, struct, iterations = 3,
                                           output = out)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation33(self):
         "binary dilation 33"
@@ -4853,7 +4853,7 @@
 
         out = ndimage.binary_dilation(data, struct,
                            iterations = -1, mask = mask, border_value = 0)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation34(self):
         "binary dilation 34"
@@ -4879,7 +4879,7 @@
         data = numpy.zeros(mask.shape, bool)
         out = ndimage.binary_dilation(data, struct,
                           iterations = -1, mask = mask, border_value = 1)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_dilation35(self):
         "binary dilation 35"
@@ -4921,7 +4921,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_dilation(data, mask = mask,
                                         origin = (1, 1), border_value = 1)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_propagation01(self):
         "binary propagation 1"
@@ -4955,7 +4955,7 @@
 
         out = ndimage.binary_propagation(data, struct,
                                             mask = mask, border_value = 0)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_propagation02(self):
         "binary propagation 2"
@@ -4981,7 +4981,7 @@
         data = numpy.zeros(mask.shape, bool)
         out = ndimage.binary_propagation(data, struct,
                                              mask = mask, border_value = 1)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_opening01(self):
         "binary opening 1"
@@ -5003,7 +5003,7 @@
                                    [0, 0, 1, 0, 0, 1, 0, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_opening(data)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_opening02(self):
         "binary opening 2"
@@ -5026,7 +5026,7 @@
                                    [0, 1, 1, 1, 1, 1, 1, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_opening(data, struct)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_closing01(self):
         "binary closing 1"
@@ -5048,7 +5048,7 @@
                                    [0, 0, 1, 0, 0, 1, 0, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_closing(data)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_closing02(self):
         "binary closing 2"
@@ -5071,7 +5071,7 @@
                                    [0, 1, 1, 1, 1, 1, 1, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_closing(data, struct)
-            self.failUnless(diff(out, true) < eps)
+            self.assertTrue(diff(out, true) < eps)
 
     def test_binary_fill_holes01(self):
         "binary fill holes 1"
@@ -5090,7 +5090,7 @@
                                [0, 0, 1, 1, 1, 1, 0, 0],
                                [0, 0, 0, 0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_fill_holes(data)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_fill_holes02(self):
         "binary fill holes 2"
@@ -5109,7 +5109,7 @@
                                [0, 0, 0, 1, 1, 0, 0, 0],
                                [0, 0, 0, 0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_fill_holes(data)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_binary_fill_holes03(self):
         "binary fill holes 3"
@@ -5128,7 +5128,7 @@
                                [0, 0, 1, 0, 0, 1, 1, 1],
                                [0, 0, 0, 0, 0, 0, 0, 0]], bool)
         out = ndimage.binary_fill_holes(data)
-        self.failUnless(diff(out, true) < eps)
+        self.assertTrue(diff(out, true) < eps)
 
     def test_grey_erosion01(self):
         "grey erosion 1"
@@ -5138,7 +5138,7 @@
         footprint = [[1, 0, 1], [1, 1, 0]]
         output = ndimage.grey_erosion(array,
                                                 footprint = footprint)
-        self.failUnless(diff([[2, 2, 1, 1, 1],
+        self.assertTrue(diff([[2, 2, 1, 1, 1],
                               [2, 3, 1, 3, 1],
                               [5, 5, 3, 3, 1]], output) < eps)
 
@@ -5151,7 +5151,7 @@
         structure = [[0, 0, 0], [0, 0, 0]]
         output = ndimage.grey_erosion(array,
                               footprint = footprint, structure = structure)
-        self.failUnless(diff([[2, 2, 1, 1, 1],
+        self.assertTrue(diff([[2, 2, 1, 1, 1],
                               [2, 3, 1, 3, 1],
                               [5, 5, 3, 3, 1]], output) < eps)
 
@@ -5164,7 +5164,7 @@
         structure = [[1, 1, 1], [1, 1, 1]]
         output = ndimage.grey_erosion(array,
                               footprint = footprint, structure = structure)
-        self.failUnless(diff([[1, 1, 0, 0, 0],
+        self.assertTrue(diff([[1, 1, 0, 0, 0],
                               [1, 2, 0, 2, 0],
                               [4, 4, 2, 2, 0]], output) < eps)
 
@@ -5176,7 +5176,7 @@
         footprint = [[0, 1, 1], [1, 0, 1]]
         output = ndimage.grey_dilation(array,
                                                  footprint = footprint)
-        self.failUnless(diff([[7, 7, 9, 9, 5],
+        self.assertTrue(diff([[7, 7, 9, 9, 5],
                               [7, 9, 8, 9, 7],
                               [8, 8, 8, 7, 7]], output) < eps)
 
@@ -5189,7 +5189,7 @@
         structure = [[0, 0, 0], [0, 0, 0]]
         output = ndimage.grey_dilation(array,
                              footprint = footprint, structure = structure)
-        self.failUnless(diff([[7, 7, 9, 9, 5],
+        self.assertTrue(diff([[7, 7, 9, 9, 5],
                               [7, 9, 8, 9, 7],
                               [8, 8, 8, 7, 7]], output) < eps)
 
@@ -5202,7 +5202,7 @@
         structure = [[1, 1, 1], [1, 1, 1]]
         output = ndimage.grey_dilation(array,
                              footprint = footprint, structure = structure)
-        self.failUnless(diff([[8,  8, 10, 10, 6],
+        self.assertTrue(diff([[8,  8, 10, 10, 6],
                               [8, 10,  9, 10, 8],
                               [9,  9,  9,  8, 8]], output) < eps)
 
@@ -5216,7 +5216,7 @@
         true = ndimage.grey_dilation(tmp, footprint = footprint)
         output = ndimage.grey_opening(array,
                                                 footprint = footprint)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
 
     def test_grey_opening02(self):
@@ -5232,7 +5232,7 @@
                                                structure = structure)
         output = ndimage.grey_opening(array,
                              footprint = footprint, structure = structure)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_grey_closing01(self):
         "grey closing 1"
@@ -5244,7 +5244,7 @@
         true = ndimage.grey_erosion(tmp, footprint = footprint)
         output = ndimage.grey_closing(array,
                                                 footprint = footprint)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_grey_closing02(self):
         "grey closing 2"
@@ -5259,7 +5259,7 @@
                                               structure = structure)
         output = ndimage.grey_closing(array,
                               footprint = footprint, structure = structure)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_morphological_gradient01(self):
         "morphological gradient 1"
@@ -5276,7 +5276,7 @@
         output = numpy.zeros(array.shape, array.dtype)
         ndimage.morphological_gradient(array,
                 footprint=footprint, structure=structure, output = output)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_morphological_gradient02(self):
         "morphological gradient 2"
@@ -5292,7 +5292,7 @@
         true = tmp1 - tmp2
         output =ndimage.morphological_gradient(array,
                                 footprint=footprint, structure=structure)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_morphological_laplace01(self):
         "morphological laplace 1"
@@ -5309,7 +5309,7 @@
         output = numpy.zeros(array.shape, array.dtype)
         ndimage.morphological_laplace(array, footprint=footprint,
                                      structure=structure, output = output)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_morphological_laplace02(self):
         "morphological laplace 2"
@@ -5325,7 +5325,7 @@
         true = tmp1 + tmp2 - 2 * array
         output = ndimage.morphological_laplace(array,
                                 footprint=footprint, structure=structure)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_white_tophat01(self):
         "white tophat 1"
@@ -5340,7 +5340,7 @@
         output = numpy.zeros(array.shape, array.dtype)
         ndimage.white_tophat(array, footprint=footprint,
                                       structure=structure, output = output)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_white_tophat02(self):
         "white tophat 2"
@@ -5354,7 +5354,7 @@
         true = array - tmp
         output = ndimage.white_tophat(array, footprint=footprint,
                                                 structure=structure)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_black_tophat01(self):
         "black tophat 1"
@@ -5369,7 +5369,7 @@
         output = numpy.zeros(array.shape, array.dtype)
         ndimage.black_tophat(array, footprint=footprint,
                                       structure=structure, output = output)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_black_tophat02(self):
         "black tophat 2"
@@ -5383,7 +5383,7 @@
         true = tmp - array
         output = ndimage.black_tophat(array, footprint=footprint,
                                                 structure=structure)
-        self.failUnless(diff(true, output) < eps)
+        self.assertTrue(diff(true, output) < eps)
 
     def test_hit_or_miss01(self):
         "binary hit-or-miss transform 1"
@@ -5410,7 +5410,7 @@
             out = numpy.zeros(data.shape, bool)
             ndimage.binary_hit_or_miss(data, struct,
                                                  output = out)
-            self.failUnless(diff(true, out) < eps)
+            self.assertTrue(diff(true, out) < eps)
 
     def test_hit_or_miss02(self):
         "binary hit-or-miss transform 2"
@@ -5427,7 +5427,7 @@
                                    [0, 1, 0, 1, 1, 1, 1, 0],
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_hit_or_miss(data, struct)
-            self.failUnless(diff(true, out) < eps)
+            self.assertTrue(diff(true, out) < eps)
 
     def test_hit_or_miss03(self):
         "binary hit-or-miss transform 3"
@@ -5456,7 +5456,7 @@
                                    [0, 0, 0, 0, 0, 0, 0, 0]], type)
             out = ndimage.binary_hit_or_miss(data, struct1,
                                               struct2)
-            self.failUnless(diff(true, out) < eps)
+            self.assertTrue(diff(true, out) < eps)
 
 
 #class NDImageTestResult(unittest.TestResult):

Modified: trunk/scipy/signal/tests/test_signaltools.py
===================================================================
--- trunk/scipy/signal/tests/test_signaltools.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/signal/tests/test_signaltools.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -88,7 +88,7 @@
         b = [2,3,4,5,3,4,2,2,1]
         def _test():
             convolve(a,b,'valid',old_behavior=self.old_behavior)
-        self.failUnlessRaises(ValueError, _test)
+        self.assertRaises(ValueError, _test)
 
     def test_same_mode(self):
         a = [1,2,3,3,1,2]
@@ -200,7 +200,7 @@
 #        f = [[2,3,4,5,6,7,8],[4,5,6,7,8,9,10]]
 #        def _test():
 #            convolve2d(e,f,'valid',old_behavior=self.old_behavior)
-#        self.failUnlessRaises(ValueError, _test)
+#        self.assertRaises(ValueError, _test)
 
 class TestFFTConvolve(TestCase):
     def test_real(self):
@@ -425,8 +425,8 @@
         zi = np.ones(0).astype(self.dt)
         y, zf = lfilter(b, a, x, zi=zi)
         assert_array_almost_equal(y, x)
-        self.failUnless(zf.dtype == self.dt)
-        self.failUnless(zf.size == 0)
+        self.assertTrue(zf.dtype == self.dt)
+        self.assertTrue(zf.size == 0)
 
 class TestLinearFilterFloat32(_TestLinearFilter):
     dt = np.float32
@@ -463,19 +463,19 @@
         a, b, y_r = self._setup_rank1()
         y = correlate(a, b, 'valid', old_behavior=False)
         assert_array_almost_equal(y, y_r[1:4])
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     def test_rank1_same(self):
         a, b, y_r = self._setup_rank1()
         y = correlate(a, b, 'same', old_behavior=False)
         assert_array_almost_equal(y, y_r[:-1])
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     def test_rank1_full(self):
         a, b, y_r = self._setup_rank1()
         y = correlate(a, b, 'full', old_behavior=False)
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank1_valid_old(self):
@@ -483,7 +483,7 @@
         a, b, y_r = self._setup_rank1()
         y = correlate(b, a, 'valid')
         assert_array_almost_equal(y, y_r[1:4])
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank1_same_old(self):
@@ -491,7 +491,7 @@
         a, b, y_r = self._setup_rank1()
         y = correlate(b, a, 'same')
         assert_array_almost_equal(y, y_r[:-1])
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank1_full_old(self):
@@ -499,7 +499,7 @@
         a, b, y_r = self._setup_rank1()
         y = correlate(b, a, 'full')
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     def _setup_rank3(self):
         a = np.linspace(0, 39, 40).reshape((2, 4, 5), order='F').astype(self.dt)
@@ -533,40 +533,40 @@
         a, b, y_r = self._setup_rank3()
         y = correlate(a, b, "valid", old_behavior=False)
         assert_array_almost_equal(y, y_r[1:2,2:4,3:5])
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     def test_rank3_same(self):
         a, b, y_r = self._setup_rank3()
         y = correlate(a, b, "same", old_behavior=False)
         assert_array_almost_equal(y, y_r[0:-1,1:-1,1:-2])
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     def test_rank3_all(self):
         a, b, y_r = self._setup_rank3()
         y = correlate(a, b, old_behavior=False)
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank3_valid_old(self):
         a, b, y_r = self._setup_rank3()
         y = correlate(b, a, "valid")
         assert_array_almost_equal(y, y_r[1:2,2:4,3:5])
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank3_same_old(self):
         a, b, y_r = self._setup_rank3()
         y = correlate(b, a, "same")
         assert_array_almost_equal(y, y_r[0:-1,1:-1,1:-2])
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank3_all_old(self):
         a, b, y_r = self._setup_rank3()
         y = correlate(b, a)
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
 def _get_testcorrelate_class(i, base):
     class TestCorrelateX(base):
@@ -598,19 +598,19 @@
         a, b, y_r = self._setup_rank1('valid')
         y = correlate(a, b, 'valid', old_behavior=False)
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     def test_rank1_same(self):
         a, b, y_r = self._setup_rank1('same')
         y = correlate(a, b, 'same', old_behavior=False)
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     def test_rank1_full(self):
         a, b, y_r = self._setup_rank1('full')
         y = correlate(a, b, 'full', old_behavior=False)
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     def test_rank3(self):
         a = np.random.randn(10, 8, 6).astype(self.dt)
@@ -625,28 +625,28 @@
 
         y = correlate(a, b, 'full', old_behavior=False)
         assert_array_almost_equal(y, y_r, decimal=4)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank1_valid_old(self):
         a, b, y_r = self._setup_rank1('valid')
         y = correlate(b, a.conj(), 'valid')
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank1_same_old(self):
         a, b, y_r = self._setup_rank1('same')
         y = correlate(b, a.conj(), 'same')
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank1_full_old(self):
         a, b, y_r = self._setup_rank1('full')
         y = correlate(b, a.conj(), 'full')
         assert_array_almost_equal(y, y_r)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
     @dec.deprecated()
     def test_rank3_old(self):
@@ -662,7 +662,7 @@
 
         y = correlate(b, a.conj(), 'full')
         assert_array_almost_equal(y, y_r, decimal=4)
-        self.failUnless(y.dtype == self.dt)
+        self.assertTrue(y.dtype == self.dt)
 
 for i in [np.csingle, np.cdouble, np.clongdouble]:
     cls = _get_testcorrelate_class(i, _TestCorrelateComplex)

Modified: trunk/scipy/spatial/tests/test_distance.py
===================================================================
--- trunk/scipy/spatial/tests/test_distance.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/spatial/tests/test_distance.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -114,7 +114,7 @@
         Y2 = cdist(X1, X2, 'test_euclidean')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
         
     def test_cdist_euclidean_random_unicode(self):
         "Tests cdist(X, u'euclidean') using unicode metric string"
@@ -126,7 +126,7 @@
         Y2 = cdist(X1, X2, u'test_euclidean')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
         
     def test_cdist_sqeuclidean_random(self):
         "Tests cdist(X, 'sqeuclidean') on random data."
@@ -138,7 +138,7 @@
         Y2 = cdist(X1, X2, 'test_sqeuclidean')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_cityblock_random(self):
         "Tests cdist(X, 'cityblock') on random data."
@@ -150,7 +150,7 @@
         Y2 = cdist(X1, X2, 'test_cityblock')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_hamming_double_random(self):
         "Tests cdist(X, 'hamming') on random data."
@@ -162,7 +162,7 @@
         Y2 = cdist(X1, X2, 'test_hamming')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_hamming_bool_random(self):
         "Tests cdist(X, 'hamming') on random boolean data."
@@ -174,7 +174,7 @@
         Y2 = cdist(X1, X2, 'test_hamming')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_jaccard_double_random(self):
         "Tests cdist(X, 'jaccard') on random data."
@@ -186,7 +186,7 @@
         Y2 = cdist(X1, X2, 'test_jaccard')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_jaccard_bool_random(self):
         "Tests cdist(X, 'jaccard') on random boolean data."
@@ -198,7 +198,7 @@
         Y2 = cdist(X1, X2, 'test_jaccard')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_chebychev_random(self):
         "Tests cdist(X, 'chebychev') on random data."
@@ -210,7 +210,7 @@
         Y2 = cdist(X1, X2, 'test_chebychev')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_minkowski_random_p3d8(self):
         "Tests cdist(X, 'minkowski') on random data. (p=3.8)"
@@ -222,7 +222,7 @@
         Y2 = cdist(X1, X2, 'test_minkowski', p=3.8)
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_minkowski_random_p4d6(self):
         "Tests cdist(X, 'minkowski') on random data. (p=4.6)"
@@ -234,7 +234,7 @@
         Y2 = cdist(X1, X2, 'test_minkowski', p=4.6)
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_minkowski_random_p1d23(self):
         "Tests cdist(X, 'minkowski') on random data. (p=1.23)"
@@ -246,7 +246,7 @@
         Y2 = cdist(X1, X2, 'test_minkowski', p=1.23)
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
 
     def test_cdist_wminkowski_random_p3d8(self):
@@ -260,7 +260,7 @@
         Y2 = cdist(X1, X2, 'test_wminkowski', p=3.8, w=w)
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_wminkowski_random_p4d6(self):
         "Tests cdist(X, 'wminkowski') on random data. (p=4.6)"
@@ -273,7 +273,7 @@
         Y2 = cdist(X1, X2, 'test_wminkowski', p=4.6, w=w)
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_wminkowski_random_p1d23(self):
         "Tests cdist(X, 'wminkowski') on random data. (p=1.23)"
@@ -286,7 +286,7 @@
         Y2 = cdist(X1, X2, 'test_wminkowski', p=1.23, w=w)
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
 
     def test_cdist_seuclidean_random(self):
@@ -299,7 +299,7 @@
         Y2 = cdist(X1, X2, 'test_seuclidean')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
 
     def test_cdist_cosine_random(self):
@@ -312,7 +312,7 @@
         Y2 = cdist(X1, X2, 'test_cosine')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_correlation_random(self):
         "Tests cdist(X, 'correlation') on random data."
@@ -324,7 +324,7 @@
         Y2 = cdist(X1, X2, 'test_correlation')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_mahalanobis_random(self):
         "Tests cdist(X, 'mahalanobis') on random data."
@@ -336,7 +336,7 @@
         Y2 = cdist(X1, X2, 'test_mahalanobis')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_canberra_random(self):
         "Tests cdist(X, 'canberra') on random data."
@@ -348,7 +348,7 @@
         Y2 = cdist(X1, X2, 'test_canberra')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_braycurtis_random(self):
         "Tests cdist(X, 'braycurtis') on random data."
@@ -361,7 +361,7 @@
         if verbose > 2:
             print Y1, Y2
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_yule_random(self):
         "Tests cdist(X, 'yule') on random data."
@@ -373,7 +373,7 @@
         Y2 = cdist(X1, X2, 'test_yule')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_matching_random(self):
         "Tests cdist(X, 'matching') on random data."
@@ -385,7 +385,7 @@
         Y2 = cdist(X1, X2, 'test_matching')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_kulsinski_random(self):
         "Tests cdist(X, 'kulsinski') on random data."
@@ -397,7 +397,7 @@
         Y2 = cdist(X1, X2, 'test_kulsinski')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_dice_random(self):
         "Tests cdist(X, 'dice') on random data."
@@ -409,7 +409,7 @@
         Y2 = cdist(X1, X2, 'test_dice')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_rogerstanimoto_random(self):
         "Tests cdist(X, 'rogerstanimoto') on random data."
@@ -421,7 +421,7 @@
         Y2 = cdist(X1, X2, 'test_rogerstanimoto')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_russellrao_random(self):
         "Tests cdist(X, 'russellrao') on random data."
@@ -433,7 +433,7 @@
         Y2 = cdist(X1, X2, 'test_russellrao')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_sokalmichener_random(self):
         "Tests cdist(X, 'sokalmichener') on random data."
@@ -445,7 +445,7 @@
         Y2 = cdist(X1, X2, 'test_sokalmichener')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
     def test_cdist_sokalsneath_random(self):
         "Tests cdist(X, 'sokalsneath') on random data."
@@ -457,7 +457,7 @@
         Y2 = cdist(X1, X2, 'test_sokalsneath')
         if verbose > 2:
             print (Y1-Y2).max()
-        self.failUnless(within_tol(Y1, Y2, eps))
+        self.assertTrue(within_tol(Y1, Y2, eps))
 
 class TestPdist(TestCase):
     """
@@ -473,7 +473,7 @@
         Y_right = eo['pdist-euclidean']
 
         Y_test1 = pdist(X, 'euclidean')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
         
     def test_pdist_euclidean_random_u(self):
         "Tests pdist(X, 'euclidean') with unicode metric string"
@@ -483,7 +483,7 @@
         Y_right = eo['pdist-euclidean']
 
         Y_test1 = pdist(X, u'euclidean')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
         
     def test_pdist_euclidean_random_float32(self):
         "Tests pdist(X, 'euclidean') on random data (float32)."
@@ -493,7 +493,7 @@
         Y_right = eo['pdist-euclidean']
 
         Y_test1 = pdist(X, 'euclidean')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_euclidean_random_nonC(self):
         "Tests pdist(X, 'test_euclidean') [the non-C implementation] on random data."
@@ -502,7 +502,7 @@
         X = eo['pdist-double-inp']
         Y_right = eo['pdist-euclidean']
         Y_test2 = pdist(X, 'test_euclidean')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_euclidean_iris_double(self):
         "Tests pdist(X, 'euclidean') on the Iris data set."
@@ -512,7 +512,7 @@
         Y_right = eo['pdist-euclidean-iris']
 
         Y_test1 = pdist(X, 'euclidean')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_euclidean_iris_float32(self):
         "Tests pdist(X, 'euclidean') on the Iris data set. (float32)"
@@ -524,7 +524,7 @@
         Y_test1 = pdist(X, 'euclidean')
         if verbose > 2:
             print np.abs(Y_right - Y_test1).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_euclidean_iris_nonC(self):
         "Tests pdist(X, 'test_euclidean') [the non-C implementation] on the Iris data set."
@@ -533,7 +533,7 @@
         X = eo['iris']
         Y_right = eo['pdist-euclidean-iris']
         Y_test2 = pdist(X, 'test_euclidean')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: seuclidean
     def test_pdist_seuclidean_random(self):
@@ -544,7 +544,7 @@
         Y_right = eo['pdist-seuclidean']
 
         Y_test1 = pdist(X, 'seuclidean')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_seuclidean_random_float32(self):
         "Tests pdist(X, 'seuclidean') on random data (float32)."
@@ -554,7 +554,7 @@
         Y_right = eo['pdist-seuclidean']
 
         Y_test1 = pdist(X, 'seuclidean')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_seuclidean_random_nonC(self):
         "Tests pdist(X, 'test_sqeuclidean') [the non-C implementation] on random data."
@@ -563,7 +563,7 @@
         X = eo['pdist-double-inp']
         Y_right = eo['pdist-seuclidean']
         Y_test2 = pdist(X, 'test_sqeuclidean')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_seuclidean_iris(self):
         "Tests pdist(X, 'seuclidean') on the Iris data set."
@@ -573,7 +573,7 @@
         Y_right = eo['pdist-seuclidean-iris']
 
         Y_test1 = pdist(X, 'seuclidean')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_seuclidean_iris_float32(self):
         "Tests pdist(X, 'seuclidean') on the Iris data set (float32)."
@@ -583,7 +583,7 @@
         Y_right = eo['pdist-seuclidean-iris']
 
         Y_test1 = pdist(X, 'seuclidean')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_seuclidean_iris_nonC(self):
         "Tests pdist(X, 'test_seuclidean') [the non-C implementation] on the Iris data set."
@@ -592,7 +592,7 @@
         X = eo['iris']
         Y_right = eo['pdist-seuclidean-iris']
         Y_test2 = pdist(X, 'test_sqeuclidean')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: cosine
     def test_pdist_cosine_random(self):
@@ -602,7 +602,7 @@
         X = eo['pdist-double-inp']
         Y_right = eo['pdist-cosine']
         Y_test1 = pdist(X, 'cosine')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_cosine_random_float32(self):
         "Tests pdist(X, 'cosine') on random data. (float32)"
@@ -612,7 +612,7 @@
         Y_right = eo['pdist-cosine']
 
         Y_test1 = pdist(X, 'cosine')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_cosine_random_nonC(self):
         "Tests pdist(X, 'test_cosine') [the non-C implementation] on random data."
@@ -621,7 +621,7 @@
         X = eo['pdist-double-inp']
         Y_right = eo['pdist-cosine']
         Y_test2 = pdist(X, 'test_cosine')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_cosine_iris(self):
         "Tests pdist(X, 'cosine') on the Iris data set."
@@ -631,7 +631,7 @@
         Y_right = eo['pdist-cosine-iris']
 
         Y_test1 = pdist(X, 'cosine')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
         #print "cosine-iris", np.abs(Y_test1 - Y_right).max()
 
     def test_pdist_cosine_iris_float32(self):
@@ -644,7 +644,7 @@
         Y_test1 = pdist(X, 'cosine')
         if verbose > 2:
             print np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
         #print "cosine-iris", np.abs(Y_test1 - Y_right).max()
 
     def test_pdist_cosine_iris_nonC(self):
@@ -654,7 +654,7 @@
         X = eo['iris']
         Y_right = eo['pdist-cosine-iris']
         Y_test2 = pdist(X, 'test_cosine')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: cityblock
     def test_pdist_cityblock_random(self):
@@ -665,7 +665,7 @@
         Y_right = eo['pdist-cityblock']
         Y_test1 = pdist(X, 'cityblock')
         #print "cityblock", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_cityblock_random_float32(self):
         "Tests pdist(X, 'cityblock') on random data. (float32)"
@@ -675,7 +675,7 @@
         Y_right = eo['pdist-cityblock']
         Y_test1 = pdist(X, 'cityblock')
         #print "cityblock", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_cityblock_random_nonC(self):
         "Tests pdist(X, 'test_cityblock') [the non-C implementation] on random data."
@@ -684,7 +684,7 @@
         X = eo['pdist-double-inp']
         Y_right = eo['pdist-cityblock']
         Y_test2 = pdist(X, 'test_cityblock')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_cityblock_iris(self):
         "Tests pdist(X, 'cityblock') on the Iris data set."
@@ -694,7 +694,7 @@
         Y_right = eo['pdist-cityblock-iris']
 
         Y_test1 = pdist(X, 'cityblock')
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
         #print "cityblock-iris", np.abs(Y_test1 - Y_right).max()
 
     def test_pdist_cityblock_iris_float32(self):
@@ -707,7 +707,7 @@
         Y_test1 = pdist(X, 'cityblock')
         if verbose > 2:
             print "cityblock-iris-float32", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_cityblock_iris_nonC(self):
         "Tests pdist(X, 'test_cityblock') [the non-C implementation] on the Iris data set."
@@ -716,7 +716,7 @@
         X = eo['iris']
         Y_right = eo['pdist-cityblock-iris']
         Y_test2 = pdist(X, 'test_cityblock')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: correlation
     def test_pdist_correlation_random(self):
@@ -728,7 +728,7 @@
 
         Y_test1 = pdist(X, 'correlation')
         #print "correlation", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_correlation_random_float32(self):
         "Tests pdist(X, 'correlation') on random data. (float32)"
@@ -739,7 +739,7 @@
 
         Y_test1 = pdist(X, 'correlation')
         #print "correlation", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_correlation_random_nonC(self):
         "Tests pdist(X, 'test_correlation') [the non-C implementation] on random data."
@@ -748,7 +748,7 @@
         X = eo['pdist-double-inp']
         Y_right = eo['pdist-correlation']
         Y_test2 = pdist(X, 'test_correlation')
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_correlation_iris(self):
         "Tests pdist(X, 'correlation') on the Iris data set."
@@ -759,7 +759,7 @@
 
         Y_test1 = pdist(X, 'correlation')
         #print "correlation-iris", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_correlation_iris_float32(self):
         "Tests pdist(X, 'correlation') on the Iris data set. (float32)"
@@ -771,7 +771,7 @@
         Y_test1 = pdist(X, 'correlation')
         if verbose > 2:
             print "correlation-iris", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_correlation_iris_nonC(self):
         "Tests pdist(X, 'test_correlation') [the non-C implementation] on the Iris data set."
@@ -781,7 +781,7 @@
         Y_right = eo['pdist-correlation-iris']
         Y_test2 = pdist(X, 'test_correlation')
         #print "test-correlation-iris", np.abs(Y_test2 - Y_right).max()
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################# minkowski
 
@@ -794,7 +794,7 @@
 
         Y_test1 = pdist(X, 'minkowski', 3.2)
         #print "minkowski", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_minkowski_random_float32(self):
         "Tests pdist(X, 'minkowski') on random data. (float32)"
@@ -805,7 +805,7 @@
 
         Y_test1 = pdist(X, 'minkowski', 3.2)
         #print "minkowski", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_minkowski_random_nonC(self):
         "Tests pdist(X, 'test_minkowski') [the non-C implementation] on random data."
@@ -814,7 +814,7 @@
         X = eo['pdist-double-inp']
         Y_right = eo['pdist-minkowski-3.2']
         Y_test2 = pdist(X, 'test_minkowski', 3.2)
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_minkowski_3_2_iris(self):
         "Tests pdist(X, 'minkowski') on iris data."
@@ -824,7 +824,7 @@
         Y_right = eo['pdist-minkowski-3.2-iris']
         Y_test1 = pdist(X, 'minkowski', 3.2)
         #print "minkowski-iris-3.2", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_minkowski_3_2_iris_float32(self):
         "Tests pdist(X, 'minkowski') on iris data. (float32)"
@@ -834,7 +834,7 @@
         Y_right = eo['pdist-minkowski-3.2-iris']
         Y_test1 = pdist(X, 'minkowski', 3.2)
         #print "minkowski-iris-3.2", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_minkowski_3_2_iris_nonC(self):
         "Tests pdist(X, 'test_minkowski') [the non-C implementation] on iris data."
@@ -843,7 +843,7 @@
         X = eo['iris']
         Y_right = eo['pdist-minkowski-3.2-iris']
         Y_test2 = pdist(X, 'test_minkowski', 3.2)
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_minkowski_5_8_iris(self):
         "Tests pdist(X, 'minkowski') on iris data."
@@ -853,7 +853,7 @@
         Y_right = eo['pdist-minkowski-5.8-iris']
         Y_test1 = pdist(X, 'minkowski', 5.8)
         #print "minkowski-iris-5.8", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_minkowski_5_8_iris_float32(self):
         "Tests pdist(X, 'minkowski') on iris data. (float32)"
@@ -865,7 +865,7 @@
         Y_test1 = pdist(X, 'minkowski', 5.8)
         if verbose > 2:
             print "minkowski-iris-5.8", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_minkowski_5_8_iris_nonC(self):
         "Tests pdist(X, 'test_minkowski') [the non-C implementation] on iris data."
@@ -874,7 +874,7 @@
         X = eo['iris']
         Y_right = eo['pdist-minkowski-5.8-iris']
         Y_test2 = pdist(X, 'test_minkowski', 5.8)
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: hamming
     def test_pdist_hamming_random(self):
@@ -886,7 +886,7 @@
 
         Y_test1 = pdist(X, 'hamming')
         #print "hamming", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_hamming_random_float32(self):
         "Tests pdist(X, 'hamming') on random data."
@@ -897,7 +897,7 @@
 
         Y_test1 = pdist(X, 'hamming')
         #print "hamming", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_hamming_random_nonC(self):
         "Tests pdist(X, 'test_hamming') [the non-C implementation] on random data."
@@ -907,7 +907,7 @@
         Y_right = eo['pdist-hamming']
         Y_test2 = pdist(X, 'test_hamming')
         #print "test-hamming", np.abs(Y_test2 - Y_right).max()
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: hamming (double)
     def test_pdist_dhamming_random(self):
@@ -918,7 +918,7 @@
         Y_right = eo['pdist-hamming']
         Y_test1 = pdist(X, 'hamming')
         #print "hamming", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_dhamming_random_float32(self):
         "Tests pdist(X, 'hamming') on random data. (float32)"
@@ -928,7 +928,7 @@
         Y_right = eo['pdist-hamming']
         Y_test1 = pdist(X, 'hamming')
         #print "hamming", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_dhamming_random_nonC(self):
         "Tests pdist(X, 'test_hamming') [the non-C implementation] on random data."
@@ -938,7 +938,7 @@
         Y_right = eo['pdist-hamming']
         Y_test2 = pdist(X, 'test_hamming')
         #print "test-hamming", np.abs(Y_test2 - Y_right).max()
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: jaccard
     def test_pdist_jaccard_random(self):
@@ -950,7 +950,7 @@
 
         Y_test1 = pdist(X, 'jaccard')
         #print "jaccard", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_jaccard_random_float32(self):
         "Tests pdist(X, 'jaccard') on random data. (float32)"
@@ -961,7 +961,7 @@
 
         Y_test1 = pdist(X, 'jaccard')
         #print "jaccard", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_jaccard_random_nonC(self):
         "Tests pdist(X, 'test_jaccard') [the non-C implementation] on random data."
@@ -971,7 +971,7 @@
         Y_right = eo['pdist-jaccard']
         Y_test2 = pdist(X, 'test_jaccard')
         #print "test-jaccard", np.abs(Y_test2 - Y_right).max()
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: jaccard (double)
     def test_pdist_djaccard_random(self):
@@ -983,7 +983,7 @@
 
         Y_test1 = pdist(X, 'jaccard')
         #print "jaccard", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_djaccard_random_float32(self):
         "Tests pdist(X, 'jaccard') on random data. (float32)"
@@ -994,7 +994,7 @@
 
         Y_test1 = pdist(X, 'jaccard')
         #print "jaccard", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_djaccard_random_nonC(self):
         "Tests pdist(X, 'test_jaccard') [the non-C implementation] on random data."
@@ -1004,7 +1004,7 @@
         Y_right = eo['pdist-jaccard']
         Y_test2 = pdist(X, 'test_jaccard')
         #print "test-jaccard", np.abs(Y_test2 - Y_right).max()
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     ################### pdist: chebychev
     def test_pdist_chebychev_random(self):
@@ -1016,7 +1016,7 @@
 
         Y_test1 = pdist(X, 'chebychev')
         #print "chebychev", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_chebychev_random_float32(self):
         "Tests pdist(X, 'chebychev') on random data. (float32)"
@@ -1028,7 +1028,7 @@
         Y_test1 = pdist(X, 'chebychev')
         if verbose > 2:
             print "chebychev", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_chebychev_random_nonC(self):
         "Tests pdist(X, 'test_chebychev') [the non-C implementation] on random data."
@@ -1038,7 +1038,7 @@
         Y_right = eo['pdist-chebychev']
         Y_test2 = pdist(X, 'test_chebychev')
         #print "test-chebychev", np.abs(Y_test2 - Y_right).max()
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_chebychev_iris(self):
         "Tests pdist(X, 'chebychev') on the Iris data set."
@@ -1048,7 +1048,7 @@
         Y_right = eo['pdist-chebychev-iris']
         Y_test1 = pdist(X, 'chebychev')
         #print "chebychev-iris", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_chebychev_iris_float32(self):
         "Tests pdist(X, 'chebychev') on the Iris data set. (float32)"
@@ -1059,7 +1059,7 @@
         Y_test1 = pdist(X, 'chebychev')
         if verbose > 2:
             print "chebychev-iris", np.abs(Y_test1 - Y_right).max()
-        self.failUnless(within_tol(Y_test1, Y_right, eps))
+        self.assertTrue(within_tol(Y_test1, Y_right, eps))
 
     def test_pdist_chebychev_iris_nonC(self):
         "Tests pdist(X, 'test_chebychev') [the non-C implementation] on the Iris data set."
@@ -1069,7 +1069,7 @@
         Y_right = eo['pdist-chebychev-iris']
         Y_test2 = pdist(X, 'test_chebychev')
         #print "test-chebychev-iris", np.abs(Y_test2 - Y_right).max()
-        self.failUnless(within_tol(Y_test2, Y_right, eps))
+        self.assertTrue(within_tol(Y_test2, Y_right, eps))
 
     def test_pdist_matching_mtica1(self):
         "Tests matching(*,*) with mtica example #1 (nums)."
@@ -1077,8 +1077,8 @@
                      np.array([1, 1, 0, 1, 1]))
         m2 = matching(np.array([1, 0, 1, 1, 0], dtype=np.bool),
                       np.array([1, 1, 0, 1, 1], dtype=np.bool))
-        self.failUnless(np.abs(m - 0.6) <= 1e-10)
-        self.failUnless(np.abs(m2 - 0.6) <= 1e-10)
+        self.assertTrue(np.abs(m - 0.6) <= 1e-10)
+        self.assertTrue(np.abs(m2 - 0.6) <= 1e-10)
 
     def test_pdist_matching_mtica2(self):
         "Tests matching(*,*) with mtica example #2."
@@ -1086,8 +1086,8 @@
                      np.array([1, 1, 0]))
         m2 = matching(np.array([1, 0, 1], dtype=np.bool),
                       np.array([1, 1, 0], dtype=np.bool))
-        self.failUnless(np.abs(m - (2.0/3.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (2.0/3.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (2.0/3.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (2.0/3.0)) <= 1e-10)
 
     def test_pdist_matching_match(self):
         "Tests pdist(X, 'matching') to see if the two implementations match on random boolean input data."
@@ -1102,8 +1102,8 @@
         if verbose > 2:
             print np.abs(y1-y2).max()
             print np.abs(y1-y3).max()
-        self.failUnless(within_tol(y1, y2, eps))
-        self.failUnless(within_tol(y2, y3, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y2, y3, eps))
 
     def test_pdist_jaccard_mtica1(self):
         "Tests jaccard(*,*) with mtica example #1."
@@ -1111,8 +1111,8 @@
                     np.array([1, 1, 0, 1, 1]))
         m2 = jaccard(np.array([1, 0, 1, 1, 0], dtype=np.bool),
                      np.array([1, 1, 0, 1, 1], dtype=np.bool))
-        self.failUnless(np.abs(m - 0.6) <= 1e-10)
-        self.failUnless(np.abs(m2 - 0.6) <= 1e-10)
+        self.assertTrue(np.abs(m - 0.6) <= 1e-10)
+        self.assertTrue(np.abs(m2 - 0.6) <= 1e-10)
 
     def test_pdist_jaccard_mtica2(self):
         "Tests jaccard(*,*) with mtica example #2."
@@ -1120,8 +1120,8 @@
                     np.array([1, 1, 0]))
         m2 = jaccard(np.array([1, 0, 1], dtype=np.bool),
                      np.array([1, 1, 0], dtype=np.bool))
-        self.failUnless(np.abs(m - (2.0/3.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (2.0/3.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (2.0/3.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (2.0/3.0)) <= 1e-10)
 
     def test_pdist_jaccard_match(self):
         "Tests pdist(X, 'jaccard') to see if the two implementations match on random double input data."
@@ -1135,8 +1135,8 @@
         if verbose > 2:
             print np.abs(y1-y2).max()
             print np.abs(y2-y3).max()
-        self.failUnless(within_tol(y1, y2, eps))
-        self.failUnless(within_tol(y2, y3, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y2, y3, eps))
 
     def test_pdist_yule_mtica1(self):
         "Tests yule(*,*) with mtica example #1."
@@ -1146,8 +1146,8 @@
                   np.array([1, 1, 0, 1, 1], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - 2.0) <= 1e-10)
-        self.failUnless(np.abs(m2 - 2.0) <= 1e-10)
+        self.assertTrue(np.abs(m - 2.0) <= 1e-10)
+        self.assertTrue(np.abs(m2 - 2.0) <= 1e-10)
 
     def test_pdist_yule_mtica2(self):
         "Tests yule(*,*) with mtica example #2."
@@ -1157,8 +1157,8 @@
                   np.array([1, 1, 0], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - 2.0) <= 1e-10)
-        self.failUnless(np.abs(m2 - 2.0) <= 1e-10)
+        self.assertTrue(np.abs(m - 2.0) <= 1e-10)
+        self.assertTrue(np.abs(m2 - 2.0) <= 1e-10)
 
     def test_pdist_yule_match(self):
         "Tests pdist(X, 'yule') to see if the two implementations match on random double input data."
@@ -1172,8 +1172,8 @@
         if verbose > 2:
             print np.abs(y1-y2).max()
             print np.abs(y2-y3).max()
-        self.failUnless(within_tol(y1, y2, eps))
-        self.failUnless(within_tol(y2, y3, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y2, y3, eps))
 
     def test_pdist_dice_mtica1(self):
         "Tests dice(*,*) with mtica example #1."
@@ -1183,8 +1183,8 @@
                   np.array([1, 1, 0, 1, 1], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - (3.0/7.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (3.0/7.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (3.0/7.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (3.0/7.0)) <= 1e-10)
 
     def test_pdist_dice_mtica2(self):
         "Tests dice(*,*) with mtica example #2."
@@ -1194,8 +1194,8 @@
                   np.array([1, 1, 0], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - 0.5) <= 1e-10)
-        self.failUnless(np.abs(m2 - 0.5) <= 1e-10)
+        self.assertTrue(np.abs(m - 0.5) <= 1e-10)
+        self.assertTrue(np.abs(m2 - 0.5) <= 1e-10)
 
     def test_pdist_dice_match(self):
         "Tests pdist(X, 'dice') to see if the two implementations match on random double input data."
@@ -1209,8 +1209,8 @@
         if verbose > 2:
             print np.abs(y1-y2).max()
             print np.abs(y2-y3).max()
-        self.failUnless(within_tol(y1, y2, eps))
-        self.failUnless(within_tol(y2, y3, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y2, y3, eps))
 
     def test_pdist_sokalsneath_mtica1(self):
         "Tests sokalsneath(*,*) with mtica example #1."
@@ -1220,8 +1220,8 @@
                          np.array([1, 1, 0, 1, 1], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - (3.0/4.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (3.0/4.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (3.0/4.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (3.0/4.0)) <= 1e-10)
 
     def test_pdist_sokalsneath_mtica2(self):
         "Tests sokalsneath(*,*) with mtica example #2."
@@ -1231,8 +1231,8 @@
                          np.array([1, 1, 0], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - (4.0/5.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (4.0/5.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (4.0/5.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (4.0/5.0)) <= 1e-10)
 
     def test_pdist_sokalsneath_match(self):
         "Tests pdist(X, 'sokalsneath') to see if the two implementations match on random double input data."
@@ -1246,8 +1246,8 @@
         if verbose > 2:
             print np.abs(y1-y2).max()
             print np.abs(y2-y3).max()
-        self.failUnless(within_tol(y1, y2, eps))
-        self.failUnless(within_tol(y2, y3, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y2, y3, eps))
 
     def test_pdist_rogerstanimoto_mtica1(self):
         "Tests rogerstanimoto(*,*) with mtica example #1."
@@ -1257,8 +1257,8 @@
                             np.array([1, 1, 0, 1, 1], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - (3.0/4.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (3.0/4.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (3.0/4.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (3.0/4.0)) <= 1e-10)
 
     def test_pdist_rogerstanimoto_mtica2(self):
         "Tests rogerstanimoto(*,*) with mtica example #2."
@@ -1268,8 +1268,8 @@
                             np.array([1, 1, 0], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - (4.0/5.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (4.0/5.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (4.0/5.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (4.0/5.0)) <= 1e-10)
 
     def test_pdist_rogerstanimoto_match(self):
         "Tests pdist(X, 'rogerstanimoto') to see if the two implementations match on random double input data."
@@ -1283,8 +1283,8 @@
         if verbose > 2:
             print np.abs(y1-y2).max()
             print np.abs(y2-y3).max()
-        self.failUnless(within_tol(y1, y2, eps))
-        self.failUnless(within_tol(y2, y3, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y2, y3, eps))
 
     def test_pdist_russellrao_mtica1(self):
         "Tests russellrao(*,*) with mtica example #1."
@@ -1294,8 +1294,8 @@
                         np.array([1, 1, 0, 1, 1], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - (3.0/5.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (3.0/5.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (3.0/5.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (3.0/5.0)) <= 1e-10)
 
     def test_pdist_russellrao_mtica2(self):
         "Tests russellrao(*,*) with mtica example #2."
@@ -1305,8 +1305,8 @@
                         np.array([1, 1, 0], dtype=np.bool))
         if verbose > 2:
             print m
-        self.failUnless(np.abs(m - (2.0/3.0)) <= 1e-10)
-        self.failUnless(np.abs(m2 - (2.0/3.0)) <= 1e-10)
+        self.assertTrue(np.abs(m - (2.0/3.0)) <= 1e-10)
+        self.assertTrue(np.abs(m2 - (2.0/3.0)) <= 1e-10)
 
     def test_pdist_russellrao_match(self):
         "Tests pdist(X, 'russellrao') to see if the two implementations match on random double input data."
@@ -1320,8 +1320,8 @@
         if verbose > 2:
             print np.abs(y1-y2).max()
             print np.abs(y2-y3).max()
-        self.failUnless(within_tol(y1, y2, eps))
-        self.failUnless(within_tol(y2, y3, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y2, y3, eps))
 
     def test_pdist_sokalmichener_match(self):
         "Tests pdist(X, 'sokalmichener') to see if the two implementations match on random double input data."
@@ -1335,8 +1335,8 @@
         if verbose > 2:
             print np.abs(y1-y2).max()
             print np.abs(y2-y3).max()
-        self.failUnless(within_tol(y1, y2, eps))
-        self.failUnless(within_tol(y2, y3, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y2, y3, eps))
 
     def test_pdist_kulsinski_match(self):
         "Tests pdist(X, 'kulsinski') to see if the two implementations match on random double input data."
@@ -1349,7 +1349,7 @@
         y3 = pdist(np.bool_(D), "test_kulsinski")
         if verbose > 2:
             print np.abs(y1-y2).max()
-        self.failUnless(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
 
     def test_pdist_canberra_match(self):
         "Tests pdist(X, 'canberra') to see if the two implementations match on the Iris data set."
@@ -1361,7 +1361,7 @@
         y2 = pdist(D, "test_canberra")
         if verbose > 2:
             print np.abs(y1-y2).max()
-        self.failUnless(within_tol(y1, y2, eps))
+        self.assertTrue(within_tol(y1, y2, eps))
 
     def test_pdist_canberra_ticket_711(self):
         "Tests pdist(X, 'canberra') to see if Canberra gives the right result as reported in Scipy bug report 711."
@@ -1370,7 +1370,7 @@
         right_y = 0.01492537
         if verbose > 2:
             print np.abs(pdist_y-right_y).max()
-        self.failUnless(within_tol(pdist_y, right_y, eps))
+        self.assertTrue(within_tol(pdist_y, right_y, eps))
 
 def within_tol(a, b, tol):
     return np.abs(a - b).max() < tol
@@ -1383,28 +1383,28 @@
         "Tests squareform on an empty matrix."
         A = np.zeros((0,0))
         rA = squareform(np.array(A, dtype='double'))
-        self.failUnless(rA.shape == (0,))
+        self.assertTrue(rA.shape == (0,))
 
     def test_squareform_empty_vector(self):
         "Tests squareform on an empty vector."
         v = np.zeros((0,))
         rv = squareform(np.array(v, dtype='double'))
-        self.failUnless(rv.shape == (1,1))
-        self.failUnless(rv[0, 0] == 0)
+        self.assertTrue(rv.shape == (1,1))
+        self.assertTrue(rv[0, 0] == 0)
 
     def test_squareform_1by1_matrix(self):
         "Tests squareform on a 1x1 matrix."
         A = np.zeros((1,1))
         rA = squareform(np.array(A, dtype='double'))
-        self.failUnless(rA.shape == (0,))
+        self.assertTrue(rA.shape == (0,))
 
     def test_squareform_one_vector(self):
         "Tests squareform on a 1-D array, length=1."
         v = np.ones((1,)) * 8.3
         rv = squareform(np.array(v, dtype='double'))
-        self.failUnless(rv.shape == (2,2))
-        self.failUnless(rv[0,1] == 8.3)
-        self.failUnless(rv[1,0] == 8.3)
+        self.assertTrue(rv.shape == (2,2))
+        self.assertTrue(rv[0,1] == 8.3)
+        self.assertTrue(rv[1,0] == 8.3)
 
     def test_squareform_2by2_matrix(self):
         "Tests squareform on a 2x2 matrix."
@@ -1412,8 +1412,8 @@
         A[0,1]=0.8
         A[1,0]=0.8
         rA = squareform(np.array(A, dtype='double'))
-        self.failUnless(rA.shape == (1,))
-        self.failUnless(rA[0] == 0.8)
+        self.assertTrue(rA.shape == (1,))
+        self.assertTrue(rA[0] == 0.8)
 
     def test_squareform_multi_matrix(self):
         "Tests squareform on a square matrices of multiple sizes."
@@ -1423,24 +1423,24 @@
     def check_squareform_multi_matrix(self, n):
         X = np.random.rand(n, 4)
         Y = pdist(X)
-        self.failUnless(len(Y.shape) == 1)
+        self.assertTrue(len(Y.shape) == 1)
         A = squareform(Y)
         Yr = squareform(A)
         s = A.shape
         k = 0
         if verbose >= 3:
             print A.shape, Y.shape, Yr.shape
-        self.failUnless(len(s) == 2)
-        self.failUnless(len(Yr.shape) == 1)
-        self.failUnless(s[0] == s[1])
+        self.assertTrue(len(s) == 2)
+        self.assertTrue(len(Yr.shape) == 1)
+        self.assertTrue(s[0] == s[1])
         for i in xrange(0, s[0]):
             for j in xrange(i+1, s[1]):
                 if i != j:
                     #print i, j, k, A[i, j], Y[k]
-                    self.failUnless(A[i, j] == Y[k])
+                    self.assertTrue(A[i, j] == Y[k])
                     k += 1
                 else:
-                    self.failUnless(A[i, j] == 0)
+                    self.assertTrue(A[i, j] == 0)
 
 class TestNumObsY(TestCase):
 
@@ -1450,23 +1450,23 @@
             X = np.random.rand(n, 4)
             Y = pdist(X)
             #print A.shape, Y.shape, Yr.shape
-            self.failUnless(num_obs_y(Y) == n)
+            self.assertTrue(num_obs_y(Y) == n)
 
     def test_num_obs_y_1(self):
         "Tests num_obs_y(y) on a condensed distance matrix over 1 observations. Expecting exception."
-        self.failUnlessRaises(ValueError, self.check_y, 1)
+        self.assertRaises(ValueError, self.check_y, 1)
 
     def test_num_obs_y_2(self):
         "Tests num_obs_y(y) on a condensed distance matrix over 2 observations."
-        self.failUnless(self.check_y(2))
+        self.assertTrue(self.check_y(2))
 
     def test_num_obs_y_3(self):
         "Tests num_obs_y(y) on a condensed distance matrix over 3 observations."
-        self.failUnless(self.check_y(3))
+        self.assertTrue(self.check_y(3))
 
     def test_num_obs_y_4(self):
         "Tests num_obs_y(y) on a condensed distance matrix over 4 observations."
-        self.failUnless(self.check_y(4))
+        self.assertTrue(self.check_y(4))
 
     def test_num_obs_y_5_10(self):
         "Tests num_obs_y(y) on a condensed distance matrix between 5 and 15 observations."
@@ -1480,10 +1480,10 @@
             a.add(n*(n-1)/2)
         for i in xrange(5, 105):
             if i not in a:
-                self.failUnlessRaises(ValueError, self.bad_y, i)
+                self.assertRaises(ValueError, self.bad_y, i)
 
     def minit(self, n):
-        self.failUnless(self.check_y(n))
+        self.assertTrue(self.check_y(n))
 
     def bad_y(self, n):
         y = np.random.rand(n)
@@ -1506,27 +1506,27 @@
             A = squareform(Y)
             if verbose >= 3:
                 print A.shape, Y.shape
-            self.failUnless(num_obs_dm(A) == n)
+            self.assertTrue(num_obs_dm(A) == n)
 
     def test_num_obs_dm_0(self):
         "Tests num_obs_dm(D) on a 0x0 distance matrix. Expecting exception."
-        self.failUnless(self.check_D(0))
+        self.assertTrue(self.check_D(0))
 
     def test_num_obs_dm_1(self):
         "Tests num_obs_dm(D) on a 1x1 distance matrix."
-        self.failUnless(self.check_D(1))
+        self.assertTrue(self.check_D(1))
 
     def test_num_obs_dm_2(self):
         "Tests num_obs_dm(D) on a 2x2 distance matrix."
-        self.failUnless(self.check_D(2))
+        self.assertTrue(self.check_D(2))
 
     def test_num_obs_dm_3(self):
         "Tests num_obs_dm(D) on a 3x3 distance matrix."
-        self.failUnless(self.check_D(2))
+        self.assertTrue(self.check_D(2))
 
     def test_num_obs_dm_4(self):
         "Tests num_obs_dm(D) on a 4x4 distance matrix."
-        self.failUnless(self.check_D(4))
+        self.assertTrue(self.check_D(4))
 
     def check_D(self, n):
         return num_obs_dm(self.make_D(n)) == n
@@ -1542,32 +1542,32 @@
     def test_is_valid_dm_int16_array_E(self):
         "Tests is_valid_dm(*) on an int16 array. Exception expected."
         D = np.zeros((5, 5), dtype='i')
-        self.failUnlessRaises(TypeError, is_valid_dm_throw, (D))
+        self.assertRaises(TypeError, is_valid_dm_throw, (D))
 
     def test_is_valid_dm_int16_array_F(self):
         "Tests is_valid_dm(*) on an int16 array. False expected."
         D = np.zeros((5, 5), dtype='i')
-        self.failUnless(is_valid_dm(D) == False)
+        self.assertTrue(is_valid_dm(D) == False)
 
     def test_is_valid_dm_improper_shape_1D_E(self):
         "Tests is_valid_dm(*) on a 1D array. Exception expected."
         D = np.zeros((5,), dtype=np.double)
-        self.failUnlessRaises(ValueError, is_valid_dm_throw, (D))
+        self.assertRaises(ValueError, is_valid_dm_throw, (D))
 
     def test_is_valid_dm_improper_shape_1D_F(self):
         "Tests is_valid_dm(*) on a 1D array. False expected."
         D = np.zeros((5,), dtype=np.double)
-        self.failUnless(is_valid_dm(D) == False)
+        self.assertTrue(is_valid_dm(D) == False)
 
     def test_is_valid_dm_improper_shape_3D_E(self):
         "Tests is_valid_dm(*) on a 3D array. Exception expected."
         D = np.zeros((3,3,3), dtype=np.double)
-        self.failUnlessRaises(ValueError, is_valid_dm_throw, (D))
+        self.assertRaises(ValueError, is_valid_dm_throw, (D))
 
     def test_is_valid_dm_improper_shape_3D_F(self):
         "Tests is_valid_dm(*) on a 3D array. False expected."
         D = np.zeros((3,3,3), dtype=np.double)
-        self.failUnless(is_valid_dm(D) == False)
+        self.assertTrue(is_valid_dm(D) == False)
 
     def test_is_valid_dm_nonzero_diagonal_E(self):
         "Tests is_valid_dm(*) on a distance matrix with a nonzero diagonal. Exception expected."
@@ -1575,7 +1575,7 @@
         D = squareform(y)
         for i in xrange(0, 5):
             D[i, i] = 2.0
-        self.failUnlessRaises(ValueError, is_valid_dm_throw, (D))
+        self.assertRaises(ValueError, is_valid_dm_throw, (D))
 
     def test_is_valid_dm_nonzero_diagonal_F(self):
         "Tests is_valid_dm(*) on a distance matrix with a nonzero diagonal. False expected."
@@ -1583,50 +1583,50 @@
         D = squareform(y)
         for i in xrange(0, 5):
             D[i, i] = 2.0
-        self.failUnless(is_valid_dm(D) == False)
+        self.assertTrue(is_valid_dm(D) == False)
 
     def test_is_valid_dm_assymetric_E(self):
         "Tests is_valid_dm(*) on an assymetric distance matrix. Exception expected."
         y = np.random.rand(10)
         D = squareform(y)
         D[1,3] = D[3,1] + 1
-        self.failUnlessRaises(ValueError, is_valid_dm_throw, (D))
+        self.assertRaises(ValueError, is_valid_dm_throw, (D))
 
     def test_is_valid_dm_assymetric_F(self):
         "Tests is_valid_dm(*) on an assymetric distance matrix. False expected."
         y = np.random.rand(10)
         D = squareform(y)
         D[1,3] = D[3,1] + 1
-        self.failUnless(is_valid_dm(D) == False)
+        self.assertTrue(is_valid_dm(D) == False)
 
     def test_is_valid_dm_correct_1_by_1(self):
         "Tests is_valid_dm(*) on a correct 1x1. True expected."
         D = np.zeros((1,1), dtype=np.double)
-        self.failUnless(is_valid_dm(D) == True)
+        self.assertTrue(is_valid_dm(D) == True)
 
     def test_is_valid_dm_correct_2_by_2(self):
         "Tests is_valid_dm(*) on a correct 2x2. True expected."
         y = np.random.rand(1)
         D = squareform(y)
-        self.failUnless(is_valid_dm(D) == True)
+        self.assertTrue(is_valid_dm(D) == True)
 
     def test_is_valid_dm_correct_3_by_3(self):
         "Tests is_valid_dm(*) on a correct 3x3. True expected."
         y = np.random.rand(3)
         D = squareform(y)
-        self.failUnless(is_valid_dm(D) == True)
+        self.assertTrue(is_valid_dm(D) == True)
 
     def test_is_valid_dm_correct_4_by_4(self):
         "Tests is_valid_dm(*) on a correct 4x4. True expected."
         y = np.random.rand(6)
         D = squareform(y)
-        self.failUnless(is_valid_dm(D) == True)
+        self.assertTrue(is_valid_dm(D) == True)
 
     def test_is_valid_dm_correct_5_by_5(self):
         "Tests is_valid_dm(*) on a correct 5x5. True expected."
         y = np.random.rand(10)
         D = squareform(y)
-        self.failUnless(is_valid_dm(D) == True)
+        self.assertTrue(is_valid_dm(D) == True)
 
 def is_valid_y_throw(y):
     return is_valid_y(y, throw=True)
@@ -1636,52 +1636,52 @@
     def test_is_valid_y_int16_array_E(self):
         "Tests is_valid_y(*) on an int16 array. Exception expected."
         y = np.zeros((10,), dtype='i')
-        self.failUnlessRaises(TypeError, is_valid_y_throw, (y))
+        self.assertRaises(TypeError, is_valid_y_throw, (y))
 
     def test_is_valid_y_int16_array_F(self):
         "Tests is_valid_y(*) on an int16 array. False expected."
         y = np.zeros((10,), dtype='i')
-        self.failUnless(is_valid_y(y) == False)
+        self.assertTrue(is_valid_y(y) == False)
 
     def test_is_valid_y_improper_shape_2D_E(self):
         "Tests is_valid_y(*) on a 2D array. Exception expected."
         y = np.zeros((3,3,), dtype=np.double)
-        self.failUnlessRaises(ValueError, is_valid_y_throw, (y))
+        self.assertRaises(ValueError, is_valid_y_throw, (y))
 
     def test_is_valid_y_improper_shape_2D_F(self):
         "Tests is_valid_y(*) on a 2D array. False expected."
         y = np.zeros((3,3,), dtype=np.double)
-        self.failUnless(is_valid_y(y) == False)
+        self.assertTrue(is_valid_y(y) == False)
 
     def test_is_valid_y_improper_shape_3D_E(self):
         "Tests is_valid_y(*) on a 3D array. Exception expected."
         y = np.zeros((3,3,3), dtype=np.double)
-        self.failUnlessRaises(ValueError, is_valid_y_throw, (y))
+        self.assertRaises(ValueError, is_valid_y_throw, (y))
 
     def test_is_valid_y_improper_shape_3D_F(self):
         "Tests is_valid_y(*) on a 3D array. False expected."
         y = np.zeros((3,3,3), dtype=np.double)
-        self.failUnless(is_valid_y(y) == False)
+        self.assertTrue(is_valid_y(y) == False)
 
     def test_is_valid_y_correct_2_by_2(self):
         "Tests is_valid_y(*) on a correct 2x2 condensed. True expected."
         y = self.correct_n_by_n(2)
-        self.failUnless(is_valid_y(y) == True)
+        self.assertTrue(is_valid_y(y) == True)
 
     def test_is_valid_y_correct_3_by_3(self):
         "Tests is_valid_y(*) on a correct 3x3 condensed. True expected."
         y = self.correct_n_by_n(3)
-        self.failUnless(is_valid_y(y) == True)
+        self.assertTrue(is_valid_y(y) == True)
 
     def test_is_valid_y_correct_4_by_4(self):
         "Tests is_valid_y(*) on a correct 4x4 condensed. True expected."
         y = self.correct_n_by_n(4)
-        self.failUnless(is_valid_y(y) == True)
+        self.assertTrue(is_valid_y(y) == True)
 
     def test_is_valid_y_correct_5_by_5(self):
         "Tests is_valid_y(*) on a correct 5x5 condensed. True expected."
         y = self.correct_n_by_n(5)
-        self.failUnless(is_valid_y(y) == True)
+        self.assertTrue(is_valid_y(y) == True)
 
     def test_is_valid_y_2_100(self):
         "Tests is_valid_y(*) on 100 improper condensed distance matrices. Expecting exception."
@@ -1690,7 +1690,7 @@
             a.add(n*(n-1)/2)
         for i in xrange(5, 105):
             if i not in a:
-                self.failUnlessRaises(ValueError, self.bad_y, i)
+                self.assertRaises(ValueError, self.bad_y, i)
 
     def bad_y(self, n):
         y = np.random.rand(n)

Modified: trunk/scipy/stats/tests/test_distributions.py
===================================================================
--- trunk/scipy/stats/tests/test_distributions.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/stats/tests/test_distributions.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -356,9 +356,9 @@
     def test_docstrings(self):
         """See ticket #761"""
         if stats.rayleigh.__doc__ is not None:
-            self.failUnless("rayleigh" in stats.rayleigh.__doc__.lower())
+            self.assertTrue("rayleigh" in stats.rayleigh.__doc__.lower())
         if stats.bernoulli.__doc__ is not None:
-            self.failUnless("bernoulli" in stats.bernoulli.__doc__.lower())
+            self.assertTrue("bernoulli" in stats.bernoulli.__doc__.lower())
 
 class TestEntropy(TestCase):
     def test_entropy_positive(self):

Modified: trunk/scipy/weave/tests/test_size_check.py
===================================================================
--- trunk/scipy/weave/tests/test_size_check.py	2010-09-13 19:53:39 UTC (rev 6804)
+++ trunk/scipy/weave/tests/test_size_check.py	2010-09-13 21:20:07 UTC (rev 6805)
@@ -40,7 +40,7 @@
         desired = desired
         assert_array_equal(actual,desired)
     def generic_error_check(self,x,y):
-        self.failUnlessRaises(ValueError, size_check.binary_op_size, x, y)
+        self.assertRaises(ValueError, size_check.binary_op_size, x, y)
 
     def desired_type(self,val):
         return np.array(val)



More information about the Scipy-svn mailing list