summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorcookedm <cookedm@localhost>2006-07-17 23:43:21 +0000
committercookedm <cookedm@localhost>2006-07-17 23:43:21 +0000
commit10943b683e107694053221df6b36e5117eb38e13 (patch)
treee2b06349dc59e9f7027b8c2b88ddaaa519f6b9a9 /numpy/lib/tests
parent2acb0e779d6d0a50288aed3c050fc1fbffaf692c (diff)
downloadnumpy-10943b683e107694053221df6b36e5117eb38e13.tar.gz
Replace ScipyTestCase with NumpyTestCase
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_arraysetops.py4
-rw-r--r--numpy/lib/tests/test_function_base.py2
-rw-r--r--numpy/lib/tests/test_getlimits.py10
-rw-r--r--numpy/lib/tests/test_index_tricks.py6
-rw-r--r--numpy/lib/tests/test_polynomial.py2
-rw-r--r--numpy/lib/tests/test_shape_base.py30
-rw-r--r--numpy/lib/tests/test_type_check.py32
7 files changed, 43 insertions, 43 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index 22f0a043c..706564410 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -10,7 +10,7 @@ restore_path()
##################################################
-class test_aso( ScipyTestCase ):
+class test_aso(NumpyTestCase):
##
# 03.11.2005, c
def check_unique1d( self ):
@@ -142,4 +142,4 @@ class test_aso( ScipyTestCase ):
assert_array_equal( c1, c2 )
if __name__ == "__main__":
- ScipyTest().run()
+ NumpyTest().run()
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 1c99eaa18..b359d5732 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -360,4 +360,4 @@ def compare_results(res,desired):
assert_array_equal(res[i],desired[i])
if __name__ == "__main__":
- ScipyTest('numpy.lib.function_base').run()
+ NumpyTest('numpy.lib.function_base').run()
diff --git a/numpy/lib/tests/test_getlimits.py b/numpy/lib/tests/test_getlimits.py
index f70081518..1eaadc953 100644
--- a/numpy/lib/tests/test_getlimits.py
+++ b/numpy/lib/tests/test_getlimits.py
@@ -10,29 +10,29 @@ restore_path()
##################################################
-class test_python_float(ScipyTestCase):
+class test_python_float(NumpyTestCase):
def check_singleton(self):
ftype = finfo(float)
ftype2 = finfo(float)
assert_equal(id(ftype),id(ftype2))
-class test_single(ScipyTestCase):
+class test_single(NumpyTestCase):
def check_singleton(self):
ftype = finfo(single)
ftype2 = finfo(single)
assert_equal(id(ftype),id(ftype2))
-class test_double(ScipyTestCase):
+class test_double(NumpyTestCase):
def check_singleton(self):
ftype = finfo(double)
ftype2 = finfo(double)
assert_equal(id(ftype),id(ftype2))
-class test_longdouble(ScipyTestCase):
+class test_longdouble(NumpyTestCase):
def check_singleton(self,level=2):
ftype = finfo(longdouble)
ftype2 = finfo(longdouble)
assert_equal(id(ftype),id(ftype2))
if __name__ == "__main__":
- ScipyTest().run()
+ NumpyTest().run()
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
index cdf20fcf9..e0be41d8a 100644
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -4,7 +4,7 @@ set_package_path()
from numpy import array, ones, r_, mgrid
restore_path()
-class test_grid(ScipyTestCase):
+class test_grid(NumpyTestCase):
def check_basic(self):
a = mgrid[-1:1:10j]
b = mgrid[-1:1:0.1]
@@ -29,7 +29,7 @@ class test_grid(ScipyTestCase):
assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)
assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)
-class test_concatenator(ScipyTestCase):
+class test_concatenator(NumpyTestCase):
def check_1d(self):
assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))
b = ones(5)
@@ -49,4 +49,4 @@ class test_concatenator(ScipyTestCase):
assert_array_equal(d[5:,:],c)
if __name__ == "__main__":
- ScipyTest().run()
+ NumpyTest().run()
diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py
index 75fcaecfb..c7609c3d5 100644
--- a/numpy/lib/tests/test_polynomial.py
+++ b/numpy/lib/tests/test_polynomial.py
@@ -79,4 +79,4 @@ class test_docs(NumpyTestCase):
def check_doctests(self): return self.rundocs()
if __name__ == "__main__":
- ScipyTest().run()
+ NumpyTest().run()
diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py
index 984c63484..debd3ae8e 100644
--- a/numpy/lib/tests/test_shape_base.py
+++ b/numpy/lib/tests/test_shape_base.py
@@ -6,7 +6,7 @@ from numpy.lib import *
from numpy.core import *
restore_path()
-class test_apply_along_axis(ScipyTestCase):
+class test_apply_along_axis(NumpyTestCase):
def check_simple(self):
a = ones((20,10),'d')
assert_array_equal(apply_along_axis(len,0,a),len(a)*ones(shape(a)[1]))
@@ -16,7 +16,7 @@ class test_apply_along_axis(ScipyTestCase):
a = ones((10,101),'d')
assert_array_equal(apply_along_axis(len,0,a),len(a)*ones(shape(a)[1]))
-class test_array_split(ScipyTestCase):
+class test_array_split(NumpyTestCase):
def check_integer_0_split(self):
a = arange(10)
try:
@@ -119,7 +119,7 @@ class test_array_split(ScipyTestCase):
array([]),array([])]
compare_results(res,desired)
-class test_split(ScipyTestCase):
+class test_split(NumpyTestCase):
"""* This function is essentially the same as array_split,
except that it test if splitting will result in an
equal split. Only test for this case.
@@ -138,7 +138,7 @@ class test_split(ScipyTestCase):
except ValueError:
pass
-class test_atleast_1d(ScipyTestCase):
+class test_atleast_1d(NumpyTestCase):
def check_0D_array(self):
a = array(1); b = array(2);
res=map(atleast_1d,[a,b])
@@ -169,7 +169,7 @@ class test_atleast_1d(ScipyTestCase):
assert(atleast_1d(3.0).shape == (1,))
assert(atleast_1d([[2,3],[4,5]]).shape == (2,2))
-class test_atleast_2d(ScipyTestCase):
+class test_atleast_2d(NumpyTestCase):
def check_0D_array(self):
a = array(1); b = array(2);
res=map(atleast_2d,[a,b])
@@ -198,7 +198,7 @@ class test_atleast_2d(ScipyTestCase):
assert(atleast_2d([3j,1]).shape == (1,2))
assert(atleast_2d([[[3,1],[4,5]],[[3,5],[1,2]]]).shape == (2,2,2))
-class test_atleast_3d(ScipyTestCase):
+class test_atleast_3d(NumpyTestCase):
def check_0D_array(self):
a = array(1); b = array(2);
res=map(atleast_3d,[a,b])
@@ -221,7 +221,7 @@ class test_atleast_3d(ScipyTestCase):
desired = [a,b]
assert_array_equal(res,desired)
-class test_hstack(ScipyTestCase):
+class test_hstack(NumpyTestCase):
def check_0D_array(self):
a = array(1); b = array(2);
res=hstack([a,b])
@@ -238,7 +238,7 @@ class test_hstack(ScipyTestCase):
desired = array([[1,1],[2,2]])
assert_array_equal(res,desired)
-class test_vstack(ScipyTestCase):
+class test_vstack(NumpyTestCase):
def check_0D_array(self):
a = array(1); b = array(2);
res=vstack([a,b])
@@ -260,7 +260,7 @@ class test_vstack(ScipyTestCase):
desired = array([[1,2],[1,2]])
assert_array_equal(res,desired)
-class test_dstack(ScipyTestCase):
+class test_dstack(NumpyTestCase):
def check_0D_array(self):
a = array(1); b = array(2);
res=dstack([a,b])
@@ -285,7 +285,7 @@ class test_dstack(ScipyTestCase):
""" array_split has more comprehensive test of splitting.
only do simple test on hsplit, vsplit, and dsplit
"""
-class test_hsplit(ScipyTestCase):
+class test_hsplit(NumpyTestCase):
""" only testing for integer splits.
"""
def check_0D_array(self):
@@ -307,7 +307,7 @@ class test_hsplit(ScipyTestCase):
desired = [array([[1,2],[1,2]]),array([[3,4],[3,4]])]
compare_results(res,desired)
-class test_vsplit(ScipyTestCase):
+class test_vsplit(NumpyTestCase):
""" only testing for integer splits.
"""
def check_1D_array(self):
@@ -324,7 +324,7 @@ class test_vsplit(ScipyTestCase):
desired = [array([[1,2,3,4]]),array([[1,2,3,4]])]
compare_results(res,desired)
-class test_dsplit(ScipyTestCase):
+class test_dsplit(NumpyTestCase):
""" only testing for integer splits.
"""
def check_2D_array(self):
@@ -345,7 +345,7 @@ class test_dsplit(ScipyTestCase):
array([[[3,4],[3,4]],[[3,4],[3,4]]])]
compare_results(res,desired)
-class test_squeeze(ScipyTestCase):
+class test_squeeze(NumpyTestCase):
def check_basic(self):
a = rand(20,10,10,1,1)
b = rand(20,1,10,1,20)
@@ -354,7 +354,7 @@ class test_squeeze(ScipyTestCase):
assert_array_equal(squeeze(b),reshape(b,(20,10,20)))
assert_array_equal(squeeze(c),reshape(c,(20,10)))
-class test_kron(ScipyTestCase):
+class test_kron(NumpyTestCase):
def check_return_type(self):
a = ones([2,2])
m = asmatrix(a)
@@ -394,4 +394,4 @@ def compare_results(res,desired):
if __name__ == "__main__":
- ScipyTest().run()
+ NumpyTest().run()
diff --git a/numpy/lib/tests/test_type_check.py b/numpy/lib/tests/test_type_check.py
index 6d93989e5..b95760c8b 100644
--- a/numpy/lib/tests/test_type_check.py
+++ b/numpy/lib/tests/test_type_check.py
@@ -11,7 +11,7 @@ restore_path()
def assert_all(x):
assert(all(x)), x
-class test_mintypecode(ScipyTestCase):
+class test_mintypecode(NumpyTestCase):
def check_default_1(self):
for itype in '1bcsuwil':
@@ -60,7 +60,7 @@ class test_mintypecode(ScipyTestCase):
#assert_equal(mintypecode('idF',savespace=1),'F')
assert_equal(mintypecode('idD'),'D')
-class test_isscalar(ScipyTestCase):
+class test_isscalar(NumpyTestCase):
def check_basic(self):
assert(isscalar(3))
assert(not isscalar([3]))
@@ -69,7 +69,7 @@ class test_isscalar(ScipyTestCase):
assert(isscalar(10L))
assert(isscalar(4.0))
-class test_real(ScipyTestCase):
+class test_real(NumpyTestCase):
def check_real(self):
y = rand(10,)
assert_array_equal(y,real(y))
@@ -78,7 +78,7 @@ class test_real(ScipyTestCase):
y = rand(10,)+1j*rand(10,)
assert_array_equal(y.real,real(y))
-class test_imag(ScipyTestCase):
+class test_imag(NumpyTestCase):
def check_real(self):
y = rand(10,)
assert_array_equal(0,imag(y))
@@ -87,7 +87,7 @@ class test_imag(ScipyTestCase):
y = rand(10,)+1j*rand(10,)
assert_array_equal(y.imag,imag(y))
-class test_iscomplex(ScipyTestCase):
+class test_iscomplex(NumpyTestCase):
def check_fail(self):
z = array([-1,0,1])
res = iscomplex(z)
@@ -97,7 +97,7 @@ class test_iscomplex(ScipyTestCase):
res = iscomplex(z)
assert_array_equal(res,[1,0,0])
-class test_isreal(ScipyTestCase):
+class test_isreal(NumpyTestCase):
def check_pass(self):
z = array([-1,0,1j])
res = isreal(z)
@@ -107,21 +107,21 @@ class test_isreal(ScipyTestCase):
res = isreal(z)
assert_array_equal(res,[0,1,1])
-class test_iscomplexobj(ScipyTestCase):
+class test_iscomplexobj(NumpyTestCase):
def check_basic(self):
z = array([-1,0,1])
assert(not iscomplexobj(z))
z = array([-1j,0,-1])
assert(iscomplexobj(z))
-class test_isrealobj(ScipyTestCase):
+class test_isrealobj(NumpyTestCase):
def check_basic(self):
z = array([-1,0,1])
assert(isrealobj(z))
z = array([-1j,0,-1])
assert(not isrealobj(z))
-class test_isnan(ScipyTestCase):
+class test_isnan(NumpyTestCase):
def check_goodvalues(self):
z = array((-1.,0.,1.))
res = isnan(z) == 0
@@ -141,7 +141,7 @@ class test_isnan(ScipyTestCase):
def check_complex1(self):
assert_all(isnan(array(0+0j)/0.) == 1)
-class test_isfinite(ScipyTestCase):
+class test_isfinite(NumpyTestCase):
def check_goodvalues(self):
z = array((-1.,0.,1.))
res = isfinite(z) == 1
@@ -161,7 +161,7 @@ class test_isfinite(ScipyTestCase):
def check_complex1(self):
assert_all(isfinite(array(1+1j)/0.) == 0)
-class test_isinf(ScipyTestCase):
+class test_isinf(NumpyTestCase):
def check_goodvalues(self):
z = array((-1.,0.,1.))
res = isinf(z) == 0
@@ -180,21 +180,21 @@ class test_isinf(ScipyTestCase):
# assert_all(isinf(log(-1.)) == 0)
# assert_all(isnan(log(-1.)) == 1)
-class test_isposinf(ScipyTestCase):
+class test_isposinf(NumpyTestCase):
def check_generic(self):
vals = isposinf(array((-1.,0,1))/0.)
assert(vals[0] == 0)
assert(vals[1] == 0)
assert(vals[2] == 1)
-class test_isneginf(ScipyTestCase):
+class test_isneginf(NumpyTestCase):
def check_generic(self):
vals = isneginf(array((-1.,0,1))/0.)
assert(vals[0] == 1)
assert(vals[1] == 0)
assert(vals[2] == 0)
-class test_nan_to_num(ScipyTestCase):
+class test_nan_to_num(NumpyTestCase):
def check_generic(self):
vals = nan_to_num(array((-1.,0,1))/0.)
assert_all(vals[0] < -1e10) and assert_all(isfinite(vals[0]))
@@ -224,7 +224,7 @@ class test_nan_to_num(ScipyTestCase):
#assert_all(vals.real < -1e10) and assert_all(isfinite(vals))
-class test_real_if_close(ScipyTestCase):
+class test_real_if_close(NumpyTestCase):
def check_basic(self):
a = rand(10)
b = real_if_close(a+1e-15j)
@@ -236,4 +236,4 @@ class test_real_if_close(ScipyTestCase):
assert_all(isrealobj(b))
if __name__ == "__main__":
- ScipyTest().run()
+ NumpyTest().run()