summaryrefslogtreecommitdiff
path: root/numpy/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2012-02-16 20:44:21 -0700
committerRalf Gommers <ralf.gommers@googlemail.com>2012-02-18 22:11:21 +0100
commit16d49fda2516d5a76f973302db96c751bba8a7ca (patch)
treee5b4de59e2a6fe809b5a274d32ce922ef727ea7e /numpy/tests
parentc4482f56b347760260a695a72f7ccbd26d02756c (diff)
downloadnumpy-16d49fda2516d5a76f973302db96c751bba8a7ca.tar.gz
DEP: Fix some functions now deprecated in Python 3.
The functions are assertEquals and assert_ (Python's TestCase, not ours).
Diffstat (limited to 'numpy/tests')
-rw-r--r--numpy/tests/test_ctypeslib.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/numpy/tests/test_ctypeslib.py b/numpy/tests/test_ctypeslib.py
index dfe7e90aa..e9729a676 100644
--- a/numpy/tests/test_ctypeslib.py
+++ b/numpy/tests/test_ctypeslib.py
@@ -44,10 +44,10 @@ class TestNdpointer(TestCase):
def test_dtype(self):
dt = np.intc
p = ndpointer(dtype=dt)
- self.assert_(p.from_param(np.array([1], dt)))
+ self.assertTrue(p.from_param(np.array([1], dt)))
dt = '<i4'
p = ndpointer(dtype=dt)
- self.assert_(p.from_param(np.array([1], dt)))
+ self.assertTrue(p.from_param(np.array([1], dt)))
dt = np.dtype('>i4')
p = ndpointer(dtype=dt)
p.from_param(np.array([1], dt))
@@ -58,41 +58,41 @@ class TestNdpointer(TestCase):
dtdescr = {'names' : dtnames, 'formats' : dtformats}
dt = np.dtype(dtdescr)
p = ndpointer(dtype=dt)
- self.assert_(p.from_param(np.zeros((10,), dt)))
+ self.assertTrue(p.from_param(np.zeros((10,), dt)))
samedt = np.dtype(dtdescr)
p = ndpointer(dtype=samedt)
- self.assert_(p.from_param(np.zeros((10,), dt)))
+ self.assertTrue(p.from_param(np.zeros((10,), dt)))
dt2 = np.dtype(dtdescr, align=True)
if dt.itemsize != dt2.itemsize:
self.assertRaises(TypeError, p.from_param, np.zeros((10,), dt2))
else:
- self.assert_(p.from_param(np.zeros((10,), dt2)))
+ self.assertTrue(p.from_param(np.zeros((10,), dt2)))
def test_ndim(self):
p = ndpointer(ndim=0)
- self.assert_(p.from_param(np.array(1)))
+ self.assertTrue(p.from_param(np.array(1)))
self.assertRaises(TypeError, p.from_param, np.array([1]))
p = ndpointer(ndim=1)
self.assertRaises(TypeError, p.from_param, np.array(1))
- self.assert_(p.from_param(np.array([1])))
+ self.assertTrue(p.from_param(np.array([1])))
p = ndpointer(ndim=2)
- self.assert_(p.from_param(np.array([[1]])))
+ self.assertTrue(p.from_param(np.array([[1]])))
def test_shape(self):
p = ndpointer(shape=(1,2))
- self.assert_(p.from_param(np.array([[1,2]])))
+ self.assertTrue(p.from_param(np.array([[1,2]])))
self.assertRaises(TypeError, p.from_param, np.array([[1],[2]]))
p = ndpointer(shape=())
- self.assert_(p.from_param(np.array(1)))
+ self.assertTrue(p.from_param(np.array(1)))
def test_flags(self):
x = np.array([[1,2,3]], order='F')
p = ndpointer(flags='FORTRAN')
- self.assert_(p.from_param(x))
+ self.assertTrue(p.from_param(x))
p = ndpointer(flags='CONTIGUOUS')
self.assertRaises(TypeError, p.from_param, x)
p = ndpointer(flags=x.flags.num)
- self.assert_(p.from_param(x))
+ self.assertTrue(p.from_param(x))
self.assertRaises(TypeError, p.from_param, np.array([[1,2,3]]))