diff options
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_arraysetops.py | 2 | ||||
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 52 | ||||
-rw-r--r-- | numpy/lib/tests/test_getlimits.py | 10 | ||||
-rw-r--r-- | numpy/lib/tests/test_index_tricks.py | 4 | ||||
-rw-r--r-- | numpy/lib/tests/test_polynomial.py | 2 | ||||
-rw-r--r-- | numpy/lib/tests/test_shape_base.py | 30 | ||||
-rw-r--r-- | numpy/lib/tests/test_twodim_base.py | 14 | ||||
-rw-r--r-- | numpy/lib/tests/test_type_check.py | 32 | ||||
-rw-r--r-- | numpy/lib/tests/test_ufunclike.py | 2 |
9 files changed, 74 insertions, 74 deletions
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py index ccdcc7556..e2e703b9a 100644 --- a/numpy/lib/tests/test_arraysetops.py +++ b/numpy/lib/tests/test_arraysetops.py @@ -11,7 +11,7 @@ restore_path() ################################################## -class test_aso(NumpyTestCase): +class TestAso(NumpyTestCase): ## # 03.11.2005, c def check_unique1d( self ): diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 77cc29199..f1b64c8d5 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -7,7 +7,7 @@ from numpy.lib import * from numpy.core import * del sys.path[0] -class test_any(NumpyTestCase): +class TestAny(NumpyTestCase): def check_basic(self): y1 = [0,0,1,0] y2 = [0,0,0,0] @@ -22,7 +22,7 @@ class test_any(NumpyTestCase): assert_array_equal(sometrue(y1,axis=0),[1,1,0]) assert_array_equal(sometrue(y1,axis=1),[0,1,1]) -class test_all(NumpyTestCase): +class TestAll(NumpyTestCase): def check_basic(self): y1 = [0,1,1,0] y2 = [0,0,0,0] @@ -38,7 +38,7 @@ class test_all(NumpyTestCase): assert_array_equal(alltrue(y1,axis=0),[0,0,1]) assert_array_equal(alltrue(y1,axis=1),[0,0,1]) -class test_average(NumpyTestCase): +class TestAverage(NumpyTestCase): def check_basic(self): y1 = array([1,2,3]) assert(average(y1,axis=0) == 2.) @@ -64,7 +64,7 @@ class test_average(NumpyTestCase): desired = array([3.,4.,5.]) assert_array_equal(actual, desired) -class test_select(NumpyTestCase): +class TestSelect(NumpyTestCase): def _select(self,cond,values,default=0): output = [] for m in range(len(cond)): @@ -84,7 +84,7 @@ class test_select(NumpyTestCase): assert_equal(len(choices),3) assert_equal(len(conditions),3) -class test_logspace(NumpyTestCase): +class TestLogspace(NumpyTestCase): def check_basic(self): y = logspace(0,6) assert(len(y)==50) @@ -95,7 +95,7 @@ class test_logspace(NumpyTestCase): y = logspace(0,6,num=7) assert_array_equal(y,[1,10,100,1e3,1e4,1e5,1e6]) -class test_linspace(NumpyTestCase): +class TestLinspace(NumpyTestCase): def check_basic(self): y = linspace(0,10) assert(len(y)==50) @@ -120,14 +120,14 @@ class test_linspace(NumpyTestCase): assert_equal(t1, t2) assert_equal(t2, t3) -class test_insert(NumpyTestCase): +class TestInsert(NumpyTestCase): def check_basic(self): a = [1,2,3] assert_equal(insert(a,0,1), [1,1,2,3]) assert_equal(insert(a,3,1), [1,2,3,1]) assert_equal(insert(a,[1,1,1],[1,2,3]), [1,1,2,3,2,3]) -class test_amax(NumpyTestCase): +class TestAmax(NumpyTestCase): def check_basic(self): a = [3,4,5,10,-3,-5,6.0] assert_equal(amax(a),10.0) @@ -137,7 +137,7 @@ class test_amax(NumpyTestCase): assert_equal(amax(b,axis=0),[8.0,10.0,9.0]) assert_equal(amax(b,axis=1),[9.0,10.0,8.0]) -class test_amin(NumpyTestCase): +class TestAmin(NumpyTestCase): def check_basic(self): a = [3,4,5,10,-3,-5,6.0] assert_equal(amin(a),-5.0) @@ -147,7 +147,7 @@ class test_amin(NumpyTestCase): assert_equal(amin(b,axis=0),[3.0,3.0,2.0]) assert_equal(amin(b,axis=1),[3.0,4.0,2.0]) -class test_ptp(NumpyTestCase): +class TestPtp(NumpyTestCase): def check_basic(self): a = [3,4,5,10,-3,-5,6.0] assert_equal(ptp(a,axis=0),15.0) @@ -157,7 +157,7 @@ class test_ptp(NumpyTestCase): assert_equal(ptp(b,axis=0),[5.0,7.0,7.0]) assert_equal(ptp(b,axis=-1),[6.0,6.0,6.0]) -class test_cumsum(NumpyTestCase): +class TestCumsum(NumpyTestCase): def check_basic(self): ba = [1,2,10,11,6,5,4] ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]] @@ -173,7 +173,7 @@ class test_cumsum(NumpyTestCase): [5,11,18,27], [10,13,17,22]],ctype)) -class test_prod(NumpyTestCase): +class TestProd(NumpyTestCase): def check_basic(self): ba = [1,2,10,11,6,5,4] ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]] @@ -191,7 +191,7 @@ class test_prod(NumpyTestCase): array([50,36,84,180],ctype)) assert_array_equal(prod(a2,axis=-1),array([24, 1890, 600],ctype)) -class test_cumprod(NumpyTestCase): +class TestCumprod(NumpyTestCase): def check_basic(self): ba = [1,2,10,11,6,5,4] ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]] @@ -216,7 +216,7 @@ class test_cumprod(NumpyTestCase): [ 5, 30, 210, 1890], [10, 30, 120, 600]],ctype)) -class test_diff(NumpyTestCase): +class TestDiff(NumpyTestCase): def check_basic(self): x = [1,4,6,7,12] out = array([3,2,1,5]) @@ -237,7 +237,7 @@ class test_diff(NumpyTestCase): assert_array_equal(diff(x,axis=0),out3) assert_array_equal(diff(x,n=2,axis=0),out4) -class test_angle(NumpyTestCase): +class TestAngle(NumpyTestCase): def check_basic(self): x = [1+3j,sqrt(2)/2.0+1j*sqrt(2)/2,1,1j,-1,-1j,1-3j,-1+3j] y = angle(x) @@ -248,7 +248,7 @@ class test_angle(NumpyTestCase): assert_array_almost_equal(y,yo,11) assert_array_almost_equal(z,zo,11) -class test_trim_zeros(NumpyTestCase): +class TestTrimZeros(NumpyTestCase): """ only testing for integer splits. """ def check_basic(self): @@ -265,7 +265,7 @@ class test_trim_zeros(NumpyTestCase): assert_array_equal(res,array([1,0,2,3,0,4])) -class test_extins(NumpyTestCase): +class TestExtins(NumpyTestCase): def check_basic(self): a = array([1,3,2,1,2,3,3]) b = extract(a>1,a) @@ -283,7 +283,7 @@ class test_extins(NumpyTestCase): place(a,mask,c) assert_array_equal(a,ac) -class test_vectorize(NumpyTestCase): +class TestVectorize(NumpyTestCase): def check_simple(self): def addsubtract(a,b): if a > b: @@ -308,7 +308,7 @@ class test_vectorize(NumpyTestCase): y = f(x) assert_array_equal(y, x) -class test_digitize(NumpyTestCase): +class TestDigitize(NumpyTestCase): def check_forward(self): x = arange(-6,5) bins = arange(-5,5) @@ -324,7 +324,7 @@ class test_digitize(NumpyTestCase): bin = linspace(x.min(), x.max(), 10) assert all(digitize(x,bin) != 0) -class test_unwrap(NumpyTestCase): +class TestUnwrap(NumpyTestCase): def check_simple(self): #check that unwrap removes jumps greather that 2*pi assert_array_equal(unwrap([1,1+2*pi]),[1,1]) @@ -332,7 +332,7 @@ class test_unwrap(NumpyTestCase): assert(all(diff(unwrap(rand(10)*100))<pi)) -class test_filterwindows(NumpyTestCase): +class TestFilterwindows(NumpyTestCase): def check_hanning(self): #check symmetry w=hanning(10) @@ -362,20 +362,20 @@ class test_filterwindows(NumpyTestCase): assert_almost_equal(sum(w,axis=0),3.7800,4) -class test_trapz(NumpyTestCase): +class TestTrapz(NumpyTestCase): def check_simple(self): r=trapz(exp(-1.0/2*(arange(-10,10,.1))**2)/sqrt(2*pi),dx=0.1) #check integral of normal equals 1 assert_almost_equal(sum(r,axis=0),1,7) -class test_sinc(NumpyTestCase): +class TestSinc(NumpyTestCase): def check_simple(self): assert(sinc(0)==1) w=sinc(linspace(-1,1,100)) #check symmetry assert_array_almost_equal(w,flipud(w),7) -class test_histogram(NumpyTestCase): +class TestHistogram(NumpyTestCase): def check_simple(self): n=100 v=rand(n) @@ -386,7 +386,7 @@ class test_histogram(NumpyTestCase): (a,b)=histogram(linspace(0,10,100)) assert(all(a==10)) -class test_histogramdd(NumpyTestCase): +class TestHistogramdd(NumpyTestCase): def check_simple(self): x = array([[-.5, .5, 1.5], [-.5, 1.5, 2.5], [-.5, 2.5, .5], \ [.5, .5, 1.5], [.5, 1.5, 2.5], [.5, 2.5, 2.5]]) @@ -436,7 +436,7 @@ class test_histogramdd(NumpyTestCase): hist, edges = histogramdd(x, bins=2) assert_array_equal(edges[0],array([-0.5, 0. , 0.5])) -class test_unique(NumpyTestCase): +class TestUnique(NumpyTestCase): def check_simple(self): x = array([4,3,2,1,1,2,3,4, 0]) assert(all(unique(x) == [0,1,2,3,4])) diff --git a/numpy/lib/tests/test_getlimits.py b/numpy/lib/tests/test_getlimits.py index 7a4fea57a..3c53f3322 100644 --- a/numpy/lib/tests/test_getlimits.py +++ b/numpy/lib/tests/test_getlimits.py @@ -11,31 +11,31 @@ restore_path() ################################################## -class test_python_float(NumpyTestCase): +class TestPythonFloat(NumpyTestCase): def check_singleton(self): ftype = finfo(float) ftype2 = finfo(float) assert_equal(id(ftype),id(ftype2)) -class test_single(NumpyTestCase): +class TestSingle(NumpyTestCase): def check_singleton(self): ftype = finfo(single) ftype2 = finfo(single) assert_equal(id(ftype),id(ftype2)) -class test_double(NumpyTestCase): +class TestDouble(NumpyTestCase): def check_singleton(self): ftype = finfo(double) ftype2 = finfo(double) assert_equal(id(ftype),id(ftype2)) -class test_longdouble(NumpyTestCase): +class TestLongdouble(NumpyTestCase): def check_singleton(self,level=2): ftype = finfo(longdouble) ftype2 = finfo(longdouble) assert_equal(id(ftype),id(ftype2)) -class test_iinfo(NumpyTestCase): +class TestIinfo(NumpyTestCase): def check_basic(self): dts = zip(['i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8'], diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py index 5d4f540b2..8fc192202 100644 --- a/numpy/lib/tests/test_index_tricks.py +++ b/numpy/lib/tests/test_index_tricks.py @@ -3,7 +3,7 @@ set_package_path() from numpy import array, ones, r_, mgrid restore_path() -class test_grid(NumpyTestCase): +class TestGrid(NumpyTestCase): def check_basic(self): a = mgrid[-1:1:10j] b = mgrid[-1:1:0.1] @@ -28,7 +28,7 @@ class test_grid(NumpyTestCase): 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(NumpyTestCase): +class TestConcatenator(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) diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py index d7c2c917d..c9a230775 100644 --- a/numpy/lib/tests/test_polynomial.py +++ b/numpy/lib/tests/test_polynomial.py @@ -76,7 +76,7 @@ poly1d([ 2.]) from numpy.testing import * import numpy as N -class test_docs(NumpyTestCase): +class TestDocs(NumpyTestCase): def check_doctests(self): return self.rundocs() def check_roots(self): diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py index b7b3458e4..c819ba366 100644 --- a/numpy/lib/tests/test_shape_base.py +++ b/numpy/lib/tests/test_shape_base.py @@ -5,7 +5,7 @@ from numpy.lib import * from numpy.core import * restore_path() -class test_apply_along_axis(NumpyTestCase): +class TestApplyAlongAxis(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])) @@ -17,7 +17,7 @@ class test_apply_along_axis(NumpyTestCase): a = arange(27).reshape((3,3,3)) assert_array_equal(apply_along_axis(sum,0,a), [[27,30,33],[36,39,42],[45,48,51]]) -class test_array_split(NumpyTestCase): +class TestArraySplit(NumpyTestCase): def check_integer_0_split(self): a = arange(10) try: @@ -120,7 +120,7 @@ class test_array_split(NumpyTestCase): array([]),array([])] compare_results(res,desired) -class test_split(NumpyTestCase): +class TestSplit(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. @@ -139,7 +139,7 @@ class test_split(NumpyTestCase): except ValueError: pass -class test_atleast_1d(NumpyTestCase): +class TestAtleast1d(NumpyTestCase): def check_0D_array(self): a = array(1); b = array(2); res=map(atleast_1d,[a,b]) @@ -170,7 +170,7 @@ class test_atleast_1d(NumpyTestCase): assert(atleast_1d(3.0).shape == (1,)) assert(atleast_1d([[2,3],[4,5]]).shape == (2,2)) -class test_atleast_2d(NumpyTestCase): +class TestAtleast2d(NumpyTestCase): def check_0D_array(self): a = array(1); b = array(2); res=map(atleast_2d,[a,b]) @@ -199,7 +199,7 @@ class test_atleast_2d(NumpyTestCase): 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(NumpyTestCase): +class TestAtleast3d(NumpyTestCase): def check_0D_array(self): a = array(1); b = array(2); res=map(atleast_3d,[a,b]) @@ -222,7 +222,7 @@ class test_atleast_3d(NumpyTestCase): desired = [a,b] assert_array_equal(res,desired) -class test_hstack(NumpyTestCase): +class TestHstack(NumpyTestCase): def check_0D_array(self): a = array(1); b = array(2); res=hstack([a,b]) @@ -239,7 +239,7 @@ class test_hstack(NumpyTestCase): desired = array([[1,1],[2,2]]) assert_array_equal(res,desired) -class test_vstack(NumpyTestCase): +class TestVstack(NumpyTestCase): def check_0D_array(self): a = array(1); b = array(2); res=vstack([a,b]) @@ -261,7 +261,7 @@ class test_vstack(NumpyTestCase): desired = array([[1,2],[1,2]]) assert_array_equal(res,desired) -class test_dstack(NumpyTestCase): +class TestDstack(NumpyTestCase): def check_0D_array(self): a = array(1); b = array(2); res=dstack([a,b]) @@ -286,7 +286,7 @@ class test_dstack(NumpyTestCase): """ array_split has more comprehensive test of splitting. only do simple test on hsplit, vsplit, and dsplit """ -class test_hsplit(NumpyTestCase): +class TestHsplit(NumpyTestCase): """ only testing for integer splits. """ def check_0D_array(self): @@ -308,7 +308,7 @@ class test_hsplit(NumpyTestCase): desired = [array([[1,2],[1,2]]),array([[3,4],[3,4]])] compare_results(res,desired) -class test_vsplit(NumpyTestCase): +class TestVsplit(NumpyTestCase): """ only testing for integer splits. """ def check_1D_array(self): @@ -325,7 +325,7 @@ class test_vsplit(NumpyTestCase): desired = [array([[1,2,3,4]]),array([[1,2,3,4]])] compare_results(res,desired) -class test_dsplit(NumpyTestCase): +class TestDsplit(NumpyTestCase): """ only testing for integer splits. """ def check_2D_array(self): @@ -346,7 +346,7 @@ class test_dsplit(NumpyTestCase): array([[[3,4],[3,4]],[[3,4],[3,4]]])] compare_results(res,desired) -class test_squeeze(NumpyTestCase): +class TestSqueeze(NumpyTestCase): def check_basic(self): a = rand(20,10,10,1,1) b = rand(20,1,10,1,20) @@ -355,7 +355,7 @@ class test_squeeze(NumpyTestCase): assert_array_equal(squeeze(b),reshape(b,(20,10,20))) assert_array_equal(squeeze(c),reshape(c,(20,10))) -class test_kron(NumpyTestCase): +class TestKron(NumpyTestCase): def check_return_type(self): a = ones([2,2]) m = asmatrix(a) @@ -372,7 +372,7 @@ class test_kron(NumpyTestCase): assert_equal(type(kron(ma,a)), myarray) -class test_tile(NumpyTestCase): +class TestTile(NumpyTestCase): def check_basic(self): a = array([0,1,2]) b = [[1,2],[3,4]] diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py index 92ddf5b34..3a9e8df80 100644 --- a/numpy/lib/tests/test_twodim_base.py +++ b/numpy/lib/tests/test_twodim_base.py @@ -17,7 +17,7 @@ def get_mat(n): data = add.outer(data,data) return data -class test_eye(NumpyTestCase): +class TestEye(NumpyTestCase): def check_basic(self): assert_equal(eye(4),array([[1,0,0,0], [0,1,0,0], @@ -55,7 +55,7 @@ class test_eye(NumpyTestCase): [1,0,0], [0,1,0]])) -class test_diag(NumpyTestCase): +class TestDiag(NumpyTestCase): def check_vector(self): vals = (100*arange(5)).astype('l') b = zeros((5,5)) @@ -84,7 +84,7 @@ class test_diag(NumpyTestCase): b[k] = vals[k+2,k] assert_equal(diag(vals,-2),b[:3]) -class test_fliplr(NumpyTestCase): +class TestFliplr(NumpyTestCase): def check_basic(self): self.failUnlessRaises(ValueError, fliplr, ones(4)) a = get_mat(4) @@ -96,7 +96,7 @@ class test_fliplr(NumpyTestCase): [5,4,3]] assert_equal(fliplr(a),b) -class test_flipud(NumpyTestCase): +class TestFlipud(NumpyTestCase): def check_basic(self): a = get_mat(4) b = a[::-1,:] @@ -107,7 +107,7 @@ class test_flipud(NumpyTestCase): [0,1,2]] assert_equal(flipud(a),b) -class test_rot90(NumpyTestCase): +class TestRot90(NumpyTestCase): def check_basic(self): self.failUnlessRaises(ValueError, rot90, ones(4)) @@ -137,7 +137,7 @@ class test_rot90(NumpyTestCase): a = ones((50,40,3)) assert_equal(rot90(a).shape,(40,50,3)) -class test_histogram2d(NumpyTestCase): +class TestHistogram2d(NumpyTestCase): def check_simple(self): x = array([ 0.41702200, 0.72032449, 0.00011437481, 0.302332573, 0.146755891]) y = array([ 0.09233859, 0.18626021, 0.34556073, 0.39676747, 0.53881673]) @@ -188,7 +188,7 @@ class test_histogram2d(NumpyTestCase): H, xed, yed = histogram2d(r, r, (4, 5), range=([0,1], [0,1])) assert_array_equal(H, 0) -class test_tri(NumpyTestCase): +class TestTri(NumpyTestCase): def test_dtype(self): out = array([[1,0,0], [1,1,0], diff --git a/numpy/lib/tests/test_type_check.py b/numpy/lib/tests/test_type_check.py index a89d6ce7f..633c34dc8 100644 --- a/numpy/lib/tests/test_type_check.py +++ b/numpy/lib/tests/test_type_check.py @@ -10,7 +10,7 @@ restore_path() def assert_all(x): assert(all(x)), x -class test_mintypecode(NumpyTestCase): +class TestMintypecode(NumpyTestCase): def check_default_1(self): for itype in '1bcsuwil': @@ -59,7 +59,7 @@ class test_mintypecode(NumpyTestCase): #assert_equal(mintypecode('idF',savespace=1),'F') assert_equal(mintypecode('idD'),'D') -class test_isscalar(NumpyTestCase): +class TestIsscalar(NumpyTestCase): def check_basic(self): assert(isscalar(3)) assert(not isscalar([3])) @@ -68,7 +68,7 @@ class test_isscalar(NumpyTestCase): assert(isscalar(10L)) assert(isscalar(4.0)) -class test_real(NumpyTestCase): +class TestReal(NumpyTestCase): def check_real(self): y = rand(10,) assert_array_equal(y,real(y)) @@ -77,7 +77,7 @@ class test_real(NumpyTestCase): y = rand(10,)+1j*rand(10,) assert_array_equal(y.real,real(y)) -class test_imag(NumpyTestCase): +class TestImag(NumpyTestCase): def check_real(self): y = rand(10,) assert_array_equal(0,imag(y)) @@ -86,7 +86,7 @@ class test_imag(NumpyTestCase): y = rand(10,)+1j*rand(10,) assert_array_equal(y.imag,imag(y)) -class test_iscomplex(NumpyTestCase): +class TestIscomplex(NumpyTestCase): def check_fail(self): z = array([-1,0,1]) res = iscomplex(z) @@ -96,7 +96,7 @@ class test_iscomplex(NumpyTestCase): res = iscomplex(z) assert_array_equal(res,[1,0,0]) -class test_isreal(NumpyTestCase): +class TestIsreal(NumpyTestCase): def check_pass(self): z = array([-1,0,1j]) res = isreal(z) @@ -106,21 +106,21 @@ class test_isreal(NumpyTestCase): res = isreal(z) assert_array_equal(res,[0,1,1]) -class test_iscomplexobj(NumpyTestCase): +class TestIscomplexobj(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(NumpyTestCase): +class TestIsrealobj(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(NumpyTestCase): +class TestIsnan(NumpyTestCase): def check_goodvalues(self): z = array((-1.,0.,1.)) res = isnan(z) == 0 @@ -148,7 +148,7 @@ class test_isnan(NumpyTestCase): assert_all(isnan(array(0+0j)/0.) == 1) seterr(**olderr) -class test_isfinite(NumpyTestCase): +class TestIsfinite(NumpyTestCase): def check_goodvalues(self): z = array((-1.,0.,1.)) res = isfinite(z) == 1 @@ -176,7 +176,7 @@ class test_isfinite(NumpyTestCase): assert_all(isfinite(array(1+1j)/0.) == 0) seterr(**olderr) -class test_isinf(NumpyTestCase): +class TestIsinf(NumpyTestCase): def check_goodvalues(self): z = array((-1.,0.,1.)) res = isinf(z) == 0 @@ -205,7 +205,7 @@ class test_isinf(NumpyTestCase): # assert_all(isinf(log(-1.)) == 0) # assert_all(isnan(log(-1.)) == 1) -class test_isposinf(NumpyTestCase): +class TestIsposinf(NumpyTestCase): def check_generic(self): olderr = seterr(divide='ignore', invalid='ignore') vals = isposinf(array((-1.,0,1))/0.) @@ -214,7 +214,7 @@ class test_isposinf(NumpyTestCase): assert(vals[1] == 0) assert(vals[2] == 1) -class test_isneginf(NumpyTestCase): +class TestIsneginf(NumpyTestCase): def check_generic(self): olderr = seterr(divide='ignore', invalid='ignore') vals = isneginf(array((-1.,0,1))/0.) @@ -223,7 +223,7 @@ class test_isneginf(NumpyTestCase): assert(vals[1] == 0) assert(vals[2] == 0) -class test_nan_to_num(NumpyTestCase): +class TestNanToNum(NumpyTestCase): def check_generic(self): olderr = seterr(divide='ignore', invalid='ignore') vals = nan_to_num(array((-1.,0,1))/0.) @@ -259,7 +259,7 @@ class test_nan_to_num(NumpyTestCase): #assert_all(vals.real < -1e10) and assert_all(isfinite(vals)) -class test_real_if_close(NumpyTestCase): +class TestRealIfClose(NumpyTestCase): def check_basic(self): a = rand(10) b = real_if_close(a+1e-15j) @@ -270,7 +270,7 @@ class test_real_if_close(NumpyTestCase): b = real_if_close(a+1e-7j,tol=1e-6) assert_all(isrealobj(b)) -class test_array_conversion(NumpyTestCase): +class TestArrayConversion(NumpyTestCase): def check_asfarray(self): a = asfarray(array([1,2,3])) assert_equal(a.__class__,ndarray) diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py index 8f9ac2833..926439fb4 100644 --- a/numpy/lib/tests/test_ufunclike.py +++ b/numpy/lib/tests/test_ufunclike.py @@ -59,7 +59,7 @@ array([ 2.169925 , 1.20163386, 2.70043972]) from numpy.testing import * -class test_docs(NumpyTestCase): +class TestDocs(NumpyTestCase): def check_doctests(self): return self.rundocs() if __name__ == "__main__": |