[Scipy-tickets] [SciPy] #1197: scipy.stats.tests test_discrete_basic.py uses plain assert

SciPy Trac scipy-tickets@scipy....
Sat Jul 3 01:47:46 CDT 2010


#1197: scipy.stats.tests  test_discrete_basic.py uses plain assert
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  low          |   Milestone:  0.8.0   
Component:  scipy.stats  |     Version:  0.7.0   
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by rgommers):

 There are asserts all over the place, not just in test_discrete_basic.py:
 {{{
 $ grin "assert "
 ./scipy/cluster/vq.py:
   673 :     assert not iter == 0
 ./scipy/constants/codata.py:
   507 :     assert (exact_values[key][0]-value(key)) / value(key) < 1e-9
   513 :     assert (exact_values[key][0]-value(key)) / value(key) == 0
 ./scipy/fftpack/basic.py:
   322 :     assert isinstance(n,int) or isinstance(n,integer)
 ./scipy/fftpack/helper.py:
    18 :     assert isinstance(n,int)
 ./scipy/fftpack/tests/test_basic.py:
   580 :         assert y.dtype == self.cdtype
 ./scipy/integrate/tests/test_integrate.py:
    24 :         assert problem.verify(z, t)
    52 :         assert ig.successful(), (problem, method)
    53 :         assert problem.verify(array([z]), problem.stop_t),
 (problem, method)
   109 :         assert ig.successful(), (problem, method)
   110 :         assert problem.verify(array([z]), problem.stop_t),
 (problem, method)
 ./scipy/integrate/tests/test_quadpack.py:
     6 :     assert abs(value-tabledValue) < err, (value, tabledValue, err)
     8 :         assert err < errTol, (err, errTol)
 ./scipy/interpolate/fitpack2.py:
   179 :             assert n<=nest,"nest can only be increased"
   248 :         assert ier==0,`ier`
   259 :             assert ier==0,`ier`
   502 :             assert ier==0,'Invalid input: ier='+`ier`
   513 :         assert ier==0, 'Invalid input: ier='+`ier`
 ./scipy/interpolate/interpolate.py:
   484 :     assert (a.ndim==2)
 ./scipy/interpolate/interpolate_wrapper.py:
    46 :     assert len(y.shape) < 3, "function only works with 1D or 2D
 arrays"
    73 :     assert len(y.shape) < 3, "function only works with 1D or 2D
 arrays"
   101 :     assert len(y.shape) < 3, "function only works with 1D or 2D
 arrays"
 ./scipy/interpolate/polyint.py:
   112 :                 assert xi[i]!=xi[k]
   666 :         assert n1<=len(y1)
   667 :         assert n2<=len(y2)
 ./scipy/interpolate/rbf.py:
   175 :         assert [x.size==self.di.size for x in self.xi], \
   205 :         assert all([x.shape == y.shape \
 ./scipy/interpolate/tests/test_interpolate.py:
    83 :         assert interp1d(self.x10, self.y10).copy
    84 :         assert not interp1d(self.x10, self.y10, copy=False).copy
    85 :         assert interp1d(self.x10, self.y10).bounds_error
    86 :         assert not interp1d(self.x10, self.y10,
 bounds_error=False).bounds_error
    87 :         assert np.isnan(interp1d(self.x10, self.y10).fill_value)
   216 :         assert np.isnan(yi[0])
   237 :         assert isinstance(interp10(1.2), np.ndarray)
 ./scipy/interpolate/tests/test_rbf.py:
    63 :     assert allclose(yi, sin(xi), atol=atol), msg
 ./scipy/io/arff/tests/test_header.py:
    25 :             assert parse_type(attrs[i][1]) == expected[i]
    45 :         assert rel == 'test1'
    48 :         assert len(attrs) == 5
    50 :             assert attrs[i][0] == 'attr%d' % i
    51 :             assert attrs[i][1] == 'REAL'
    55 :         assert attrs[4][0] == 'class'
    56 :         assert attrs[4][1] == '{class0, class1, class2, class3}'
 ./scipy/io/matlab/mio5.py:
   345 :         assert byte_count > 0
   358 :             assert dcor.flush() == ''
 ./scipy/io/matlab/tests/test_byteordercodes.py:
    13 :     assert sibc.sys_is_le == native_is_le
    17 :         assert sibc.to_numpy_code('native') == '<'
    18 :         assert sibc.to_numpy_code('swapped') == '>'
    20 :         assert sibc.to_numpy_code('native') == '>'
    21 :         assert sibc.to_numpy_code('swapped') == '<'
    22 :     assert sibc.to_numpy_code('native') == sibc.to_numpy_code('=')
    23 :     assert sibc.to_numpy_code('big') == '>'
    25 :         assert sibc.to_numpy_code(code) == '<'
    27 :         assert sibc.to_numpy_code(code) == '>'
 ./scipy/io/mmio.py:
   187 :             assert matrix == 'matrix',`line`
   199 :                 assert len(line)==2,`line`
   203 :                 assert len(line)==3,`line`
   383 :             assert i in [0,j] and j==cols,`i,j,rows,cols`
   410 :             assert k==entries,`k,entries`
 ./scipy/io/netcdf.py:
   418 :         assert header in [ZERO, NC_DIMENSION]
   433 :         assert header in [ZERO, NC_ATTRIBUTE]
   444 :         assert header in [ZERO, NC_VARIABLE]
 ./scipy/io/tests/test_recaster.py:
    13 :         assert set(R.sctype_list) ==
 set(sctype_attributes().keys()), \
    17 :         assert R.sctype_list == [T], 'Scalar type list not
 correctly set'
    21 :         assert tols == R.sctype_tols, 'Unexpected tols dictionary'
    27 :         assert R.sctype_tols[T]['rtol'] == F.eps*2, \
    29 :         assert R.sctype_tols[T]['atol'] == F.tiny*2, \
    33 :         assert R.sctype_tols[T]['rtol'] == F.eps, \
    35 :         assert R.sctype_tols[T]['atol'] == F.tiny, \
    65 :                 assert arr is None, \
    69 :             assert arr is not None, \
    72 :             assert dtt is outp, \
    89 :             assert np.dtype(rt) == np.dtype(T), \
   101 :                     assert rt == np.int32, \
   104 :                     assert rt is None, \
   110 :         assert rt == np.int16, 'Expected int16, got %s' % rt
   112 :         assert rt == np.int16, 'Expected int16, got %s' % rt
   114 :         assert rt == np.uint16, 'Expected uint16, got %s' % rt
   166 :             assert arr is not None, \
   169 :             assert dtt is outp, \
 ./scipy/io/tests/test_wavfile.py:
    13 :     assert rate == 44100
    14 :     assert np.issubdtype(data.dtype, np.int32)
    15 :     assert data.shape == (4410,)
    19 :     assert rate == 8000
    20 :     assert np.issubdtype(data.dtype, np.uint8)
    21 :     assert data.shape == (800, 2)
    39 :         assert rate == rate2
    40 :         assert data2.dtype.byteorder in ('<', '=', '|'),
 data2.dtype
 ./scipy/lib/blas/setup.py:
    96 :         assert name=='cblas', repr(name)
   106 :             assert os.path.basename(target)=='cblas.pyf.src'
 ./scipy/lib/blas/tests/test_fblas.py:
    25 :     assert a.shape[1] == b.shape[0]
 ./scipy/lib/lapack/setup.py:
    72 :         assert name=='clapack',`name`
    82 :             assert os.path.basename(target)=='clapack.pyf.src'
 ./scipy/lib/lapack/tests/test_esv.py:
    25 :         assert not info, `info`
    44 :         assert not info, `info`
    66 :         assert not info, `info`
 ./scipy/lib/lapack/tests/test_gesv.py:
    25 :         assert not info, `info`
 ./scipy/lib/lapack/tests/test_lapack.py:
    29 :         assert not info, `info`
    35 :         assert not info, `info`
    52 :         assert not info,`info`
 ./scipy/linalg/benchmarks/bench_basic.py:
    37 :             assert not a.flags['CONTIGUOUS']
    74 :             assert not a.flags['CONTIGUOUS']
   110 :             assert not a.flags['CONTIGUOUS']
 ./scipy/linalg/tests/test_basic.py:
   500 :             assert r==m,'unexpected efficient rank'
   513 :             assert r==m,'unexpected efficient rank'
 ./scipy/linalg/tests/test_decomp.py:
    50 :     assert act == des, 'dtype mismatch: "%s" (should be "%s")
 '%(act, des)
   756 :         assert len(s)==3
   757 :         assert s[0]>=s[1]>=s[2]
   762 :         assert len(s)==2
   763 :         assert s[0]>=s[1]
   768 :         assert len(s)==2
   769 :         assert s[0]>=s[1]
   774 :         assert len(s)==3
   775 :         assert s[0]>=s[1]>=s[2]
   780 :         assert len(s)==2
   781 :         assert s[0]>=s[1]
   786 :         assert len(s)==2
   787 :         assert s[0]>=s[1]
 ./scipy/linalg/tests/test_fblas.py:
    27 :     assert a.shape[1] == b.shape[0]
 ./scipy/linalg/tests/test_lapack.py:
    24 :             assert not info,`info`
    30 :             assert not info,`info`
    42 :             assert not info,`info`
 ./scipy/linalg/tests/test_special_matrices.py:
   218 :         assert all(x == [[1, 0, 0, 0, 0, 0, 0],
 ./scipy/maxentropy/examples/bergerexamplesimulated.py:
    38 :     assert algorithm in ['CG', 'BFGS', 'LBFGSB', 'Powell',
 'Nelder-Mead']
 ./scipy/maxentropy/maxentropy.py:
   208 :             assert len(self.params) == len(K)
   870 :         assert isinstance(S, int)
  1439 :         assert type(sampler) is types.GeneratorType
  1638 :         assert len(F_list) == len(logprob_list)
 ./scipy/misc/common.py:
   189 :     assert (Np >= ndiv+1), "Number of points must be at least the
 derivative order + 1."
   190 :     assert (Np % 2 == 1), "Odd-number of points only."
   228 :     assert (order >= n+1), "Number of points must be at least the
 derivative order + 1."
   229 :     assert (order % 2 == 1), "Odd number of points only."
 ./scipy/misc/pilutil.py:
   143 :     assert valid, "Not a suitable array shape for any mode."
   214 :         assert numch == 3, "Invalid array shape for mode."
   216 :         assert numch == 4, "Invalid array shape for mode."
 ./scipy/misc/ppimport.py:
   268 :                 assert module is self,`(module, self)`
   284 :         assert isinstance(module,types.ModuleType),`module`
 ./scipy/misc/tests/test_pilutil.py:
    35 :     assert img.min() >= imin
    36 :     assert img.max() <= imax
 ./scipy/ndimage/tests/test_ndimage.py:
  2118 :                 assert numpy.all(arr[-1,:] != 0)
  2119 :                 assert numpy.all(arr[-1,:] >= (20 - eps))
  2120 :                 assert numpy.all(arr[0,:] <= (5 + eps))
  2121 :                 assert numpy.all(arr >= (0 - eps))
  2122 :                 assert numpy.all(arr <= (24 + eps))
 ./scipy/optimize/optimize.py:
  1337 :             assert ((xa < xb) and (xb < xc)), "Not a bracketing
 interval."
  1341 :             assert ((fb<fa) and (fb < fc)), "Not a bracketing
 interval."
  1521 :         assert ((xa < xb) and (xb < xc)), "Not a bracketing
 interval."
  1525 :         assert ((fb<fa) and (fb < fc)), "Not a bracketing
 interval."
 ./scipy/optimize/tests/test_nnls.py:
    20 :         assert res<1e-7
    21 :         assert norm(dot(a,x)-y)<1e-7
 ./scipy/optimize/tests/test_nonlin.py:
    38 :         assert nonlin.norm(x)<1e-7
    39 :         assert nonlin.norm(F(x))<1e-7
    43 :         assert nonlin.norm(x)<1e-9
    44 :         assert nonlin.norm(F(x))<1e-9
    48 :         assert nonlin.norm(x)<1e-9
    49 :         assert nonlin.norm(F(x))<1e-9
    53 :         assert nonlin.norm(x)<1e-9
    54 :         assert nonlin.norm(F(x))<1e-9
    58 :         assert nonlin.norm(x)<1e-5
    59 :         assert nonlin.norm(F(x))<1e-5
    63 :         assert nonlin.norm(x)<0.33
    67 :         assert nonlin.norm(x)<0.2
    71 :         assert nonlin.norm(x)<1e-7
    72 :         assert nonlin.norm(F(x))<1e-7
    74 :         assert nonlin.norm(x)<2e-4
    75 :         assert nonlin.norm(F(x))<2e-4
    79 :         assert nonlin.norm(x)<1e-9
    80 :         assert nonlin.norm(F(x))<1e-9
    84 :         assert nonlin.norm(x)<1e-9
    85 :         assert nonlin.norm(F(x))<1e-9
    89 :         assert nonlin.norm(x)<1e-9
    90 :         assert nonlin.norm(F(x))<1e-9
 ./scipy/optimize/tests/test_optimize.py:
    65 :         assert err < 1e-6
    79 :         assert err < 1e-6
    93 :         assert err < 1e-6
   106 :         assert err < 1e-6
   120 :         assert err < 1e-6
   134 :         assert err < 1e-6
   148 :         assert max((err1,err2,err3,err4)) < 1e-6
   155 :         assert abs(x - 1) < 1e-5
   157 :         assert abs(x - 1.5) < 1e-6
   160 :         assert abs(x - 1.5) < 1e-6
 ./scipy/optimize/tests/test_zeros.py:
    18 :             assert r.converged
 ./scipy/signal/tests/test_signaltools.py:
   256 :         assert np.allclose(c, d, rtol=1e-10)
 ./scipy/signal/tests/test_wavelets.py:
    21 :                 assert len(x) == len(phi) == len(psi)
 ./scipy/sparse/dok.py:
    97 :             assert isintlike(i) and isintlike(j)
   101 :             assert not (i < 0 or i >= self.shape[0] or j < 0 or j
 >= self.shape[1])
 ./scipy/sparse/linalg/dsolve/SuperLU/SRC/colamd.c:
   816 : #define ASSERT(expression) (assert (expression))
 ./scipy/sparse/linalg/dsolve/tests/test_linsolve.py:
    55 :         assert abs(x - r).max() < 1e-13
    62 :         assert abs(x - r).max() < 1e-2
    63 :         assert abs(x - r).max() > 1e-5
 ./scipy/sparse/linalg/eigen/lobpcg/lobpcg.py:
   431 :             assert np.allclose( gramA.T, gramA )
   437 :             assert np.allclose( gramB.T, gramB )
 ./scipy/sparse/linalg/isolve/tests/test_lgmres.py:
    31 :     assert allclose(A*x0, b, rtol=1e-12, atol=1e-12), norm(A*x0-b)
    44 :         assert count_1 == 3
    45 :         assert count_1 < count_0/2
    46 :         assert allclose(x1, x0, rtol=1e-14)
    53 :         assert len(outer_v) > 0
    54 :         assert len(outer_v) <= 6
    57 :         assert count_1 == 2, count_1
    58 :         assert count_1 < count_0/2
    59 :         assert allclose(x1, x0, rtol=1e-14)
    65 :         assert array([v[1] is None for v in outer_v]).all()
    66 :         assert len(outer_v) > 0
    67 :         assert len(outer_v) <= 6
    70 :         assert count_1 == 3, count_1
    71 :         assert count_1 < count_0/2
    72 :         assert allclose(x1, x0, rtol=1e-14)
 ./scipy/sparse/linalg/isolve/tests/test_lsqr.py:
    28 :     assert norm(svx - xo) < 1e-5
 ./scipy/sparse/tests/test_base.py:
   558 :             assert B[0,0]!=A[0,0]
   691 :         assert caught == 2
   726 :         assert caught == 2
  1207 :         # assert that the last column is all zeros
  1218 :         # assert that the last row is all zeros
 ./scipy/spatial/kdtree.py:
   182 :                 assert np.all(data==data[0]), "Troublesome data
 array: %s" % data
 ./scipy/spatial/tests/test_kdtree.py:
    15 :         assert
 np.all(np.sum((self.data-x[np.newaxis,:])**2,axis=1)>d**2-eps)
    38 :             assert near_d<d+eps, "near_d=%g should be less than
 %g" % (near_d,d)
    52 :             assert near_d<d+eps, "near_d=%g should be less than
 %g" % (near_d,d)
    65 :             assert near_d<d+eps, "near_d=%g should be less than
 %g" % (near_d,d)
    74 :         assert np.all(d<=d_real*(1+eps))
   153 :         assert isinstance(d,float)
   154 :         assert isinstance(i,int)
   167 :         assert np.all(~np.isfinite(d[-s:]))
   168 :         assert np.all(i[-s:]==self.kdtree.n)
   175 :         assert np.all(~np.isfinite(d[:,:,-s:]))
   176 :         assert np.all(i[:,:,-s:]==self.kdtree.n)
   179 :         assert isinstance(d,list)
   180 :         assert isinstance(i,list)
   186 :         assert isinstance(d[0,0],list)
   187 :         assert isinstance(i[0,0],list)
   203 :         assert isinstance(d,float)
   204 :         assert isinstance(i,int)
   224 :         assert np.all(~np.isfinite(d[-s:]))
   225 :         assert np.all(i[-s:]==self.kdtree.n)
   232 :         assert np.all(~np.isfinite(d[:,:,-s:]))
   233 :         assert np.all(i[:,:,-s:]==self.kdtree.n)
   240 :             assert
 distance(self.data[i],self.x,self.p)<=self.d*(1.+self.eps)
   246 :         assert
 np.all(distance(self.data[c],self.x,self.p)>=self.d/(1.+self.eps))
   292 :     assert isinstance(r[0,0],list)
   300 :                 assert
 distance(self.data1[i],self.data2[j],self.p)<=self.d*(1.+self.eps)
   306 :             assert
 np.all(distance(self.data2[c],self.data1[i],self.p)>=self.d/(1.+self.eps))
   392 :         assert np.all(np.diff(results)>=0)
   411 :             assert j in r[i]
   445 :     assert s == T.query_pairs(d)
 ./scipy/special/SConscript:
    31 :     assert len(src) > 0
 ./scipy/special/tests/test_basic.py:
  1572 :                 assert np.abs(c2) >= 1e300, (v, z)
  1574 :                 assert c2.imag != 0, (v, z)
  1621 :         assert dc[k] < 1e-9, (v[k], x[k], iv(v[k], x[k]), iv(v[k],
 x[k]+0j))
  1678 :         assert isnan(jv(0.5, -1))
  1679 :         assert isnan(iv(0.5, -1))
  1680 :         assert isnan(yv(0.5, -1))
  1681 :         assert isnan(yv(1, -1))
  1682 :         assert isnan(kv(0.5, -1))
  1683 :         assert isnan(kv(1, -1))
  1684 :         assert isnan(jve(0.5, -1))
  1685 :         assert isnan(ive(0.5, -1))
  1686 :         assert isnan(yve(0.5, -1))
  1687 :         assert isnan(yve(1, -1))
  1688 :         assert isnan(kve(0.5, -1))
  1689 :         assert isnan(kve(1, -1))
  1690 :         assert isnan(airye(-1)[0:2]).all(), airye(-1)
  1691 :         assert not isnan(airye(-1)[2:4]).any(), airye(-1)
  2132 :         assert isnan(struve(-7.1, -1))
  2133 :         assert isnan(struve(-10.1, -1))
 ./scipy/special/tests/test_lambertw.py:
    16 :     assert isnan(lambertw(nan))
 ./scipy/special/tests/test_orthogonal_eval.py:
    14 :     assert np.allclose(v1, v2, rtol=1e-15)
 ./scipy/special/tests/testutils.py:
   183 :         assert len(got) == len(wanted)
   223 :                 assert False, "\n".join(msg)
 ./scipy/stats/mstats_basic.py:
  1294 :         assert a.ndim <= 2, "Array should be 2D at most !"
  1518 :         assert data.ndim <= 2, "Array should be 2D at most !"
 ./scipy/stats/mstats_extras.py:
    95 :         assert data.ndim <= 2, "Array should be 2D at most !"
   165 :         assert data.ndim <= 2, "Array should be 2D at most !"
   239 :     assert data.ndim <= 2, "Array should be 2D at most !"
   308 :         assert data.ndim <= 2, "Array should be 2D at most !"
 ./scipy/stats/stats.py:
  3152 :     assert len(args) >= 2, "Need at least 2 groups in
 stats.kruskal()"
 ./scipy/stats/tests/test_continuous_basic.py:
   220 :         assert np.isinf(m1), \
   227 :         assert np.isinf(m2), \
   260 :     assert prob>0.01, 'mean fail, t,prob = %f, %f, m,sm=%f,%f' %
 (t,prob,popmean,sm)
   269 :     assert pval>0.01, 'var fail, t,pval = %f, %f, v,sv=%f,%f' %
 (chi2,pval,popvar,sv)
   285 : ##        assert abs(sm) > 10000, 'infinite moment, sm = ' +
 str(sm)
   324 :         assert (pval > alpha), "D = " + str(D) + "; pval = " +
 str(pval) + \
 ./scipy/stats/tests/test_continuous_extra.py:
    59 :     assert np.isnan(below), msg + 'ppf out of bounds - below'
    60 :     assert np.isnan(above), msg + 'ppf out of bounds - above'
    65 :     assert not np.any(np.isnan(ppfs)), msg + 'ppf private is nan'
    74 :     assert np.isnan(below), msg + 'isf out of bounds - below'
    75 :     assert np.isnan(above), msg + 'isf out of bounds - above'
    88 :     assert not np.isnan(ent), msg + 'test Entropy is nan'\
    91 :     assert not np.isnan(v1)
    96 :         assert np.isinf(v2) or np.isnan(v2), \
 ./scipy/stats/tests/test_discrete_basic.py:
    34 :         #assert stats.dlaplace.rvs(0.8) is not None
    90 :         assert sm > 10000, 'infinite moment, sm = ' + str(sm)
   100 :     assert (distfn.ppf(cdf05+1e-4,*arg)>ppf05), msg + 'ppf-cdf-
 next'
   115 :     assert (distfn._ppf(cdf05+1e-4,*arg)>ppf05), msg + '_ppf-cdf-
 next'
   118 :     assert distfn.ppf(0.5,*arg) < np.inf
   121 :     assert np.all(ppfs < np.inf)
   122 :     assert ppf_s[0] == distfn.ppf(0.5,*arg)
   123 :     assert ppf_s[1] == distfn.ppf(0.9,*arg)
   124 :     assert ppf_s[0] == ppfs[0]
   125 :     assert ppf_s[1] == ppfs[1]
   150 :     assert distfn.sf(median_sf - 1, *arg) > 0.5
   151 :     assert distfn.cdf(median_sf + 1, *arg) > 0.5
   163 :     assert np.isnan(below), msg + 'ppf out of bounds - below'
   164 :     assert np.isnan(above), msg + 'ppf out of bounds - above'
   172 :     assert np.isnan(below), msg + 'isf out of bounds - below'
   173 :     assert np.isnan(above), msg + 'isf out of bounds - above'
   176 :     assert not np.isnan(v1)
   181 :         assert np.isinf(v2) or np.isnan(v2), \
   193 :     assert not np.isnan(ent), msg + 'test Entropy is nan'\
   256 :     assert (pval > alpha), 'chisquare - test for %s' \
 ./scipy/stats/tests/test_distributions.py:
    23 :     assert (q < qtest), "Failed q=%f, bound=%f, alpha=%f" % (q,
 qtest, significance)
    48 :         assert (pval > alpha), "D = " + str(D) + "; pval = " +
 str(pval) + \
   105 :         assert isinstance(val, numpy.ScalarType),`type(val)`
   253 :             assert abs(sum(x == s)/float(samples) - p) < 0.05
 ./scipy/stats/tests/test_mstats_basic.py:
    50 :         assert not isinstance(desired1, ma.MaskedArray)
 ./scipy/stats/tests/test_stats.py:
   211 :         assert np.isnan(m)
   226 :         assert np.isnan(s)
   245 :         assert np.isnan(m)
 ./scipy/weave/accelerate_tools.py:
    23 :     assert isinstance(s, str), "only None and string allowed"
    81 :         assert symbol in ['+','-','*','/'],symbol
   136 :         assert self.dims == len(v),'Expect dimension %d'%self.dims
   139 :             # assert that ''t[i]'' is an integer
   276 :         assert inspect.isfunction(function)
   386 :         assert inspect.isfunction(f)
   388 :         assert reduce(lambda x,y: x and y,
 ./scipy/weave/blitz/blitz/bzdebug.h:
    52 :    *   // Some operation which should cause an assert to fail
    78 :         cerr << "Unexpected assert failure!" << endl;
 ./scipy/weave/bytecodecompiler.py:
   183 :     assert inspect.isfunction(f)
   694 :         assert inspect.isfunction(function)
   695 :         assert not function.func_defaults ,"Function cannot have
 default args (yet)"
   909 :         assert isinstance(v, tuple)
   912 :         assert isinstance(t, tuple)
   920 :         assert isinstance(V, tuple)
   922 :         assert isinstance(T, tuple)
   932 :         assert isinstance(v, tuple)
   935 :         assert isinstance(t, tuple)
  1060 :         assert rhs_type == t0,"Store the right thing"
  1197 :         assert t2 is aType
 ./scipy/weave/examples/vtk_example.py:
   110 :         assert (val < 1e-6), "i = %d, val= %f"%(i, val)
 ./scipy/weave/tests/test_catalog.py:
    51 :         assert (d2 == d)
    57 :         assert (d == in_path)
    62 :         assert (path is None)
   119 :         assert (r == 'bob')
   123 :         assert (r is None)
   126 :         assert (r is None)
 ./scipy/weave/tests/test_scxx_dict.py:
    24 :         assert sys.getrefcount(res) == 2
    25 :         assert res == {}
    40 :         assert res
    49 :         assert res
    58 :         assert res
    68 :         assert res
    78 :         assert res
    88 :         assert res
    97 :         assert not res
   106 :         assert res == a['b']
   157 :         assert a[key] == val
   160 :         assert a[key] == val
   162 :         assert before == after
   171 :         assert a[key] == val
   174 :         assert a[key] == val
   177 :         assert before == after
   178 :         assert before_overwritten == after_overwritten
   234 :         assert key not in a
   238 :         assert key not in a
   240 :         assert before[0] == after[0]
   241 :         assert before[1] == after[1] + 1
   271 :         assert not a
   277 :         assert items == a.items()
   283 :         assert values == a.values()
   289 :         assert keys == a.keys()
   296 :         assert a == b
 ./scipy/weave/tests/test_scxx_object.py:
   166 :         assert res
   176 :         assert res
   185 :         assert not res
   216 :         assert res
   365 :         assert not hasattr(a,"b")
   522 :         assert res
   529 :         assert not res
 ./scipy/weave/tests/test_scxx_sequence.py:
    47 :         assert res == 1
    50 :         assert res == 0
    55 :         assert res == 1
    58 :         assert res == 0
    63 :         assert res == 1
    66 :         assert res == 0
    71 :         assert res == 1
    74 :         assert res == 0
    82 :         assert res == 1
    88 :         assert res == 0
   100 :         assert res == 1
   105 :         assert res == 1
   110 :         assert res == 1
   115 :         assert res == 1
   123 :         assert res == 1
   182 :         assert list(b) == list(a)
   206 :         assert a == (1,2,3)
   208 :         assert sys.getrefcount(a) == 2
   219 :             assert 0
   230 :             assert 0
   248 :         assert a[0] is item
   252 :         assert after1 == before1
   253 :         assert after2 == before2
   265 :         assert sys.getrefcount(a[0]) == 2
   266 :         assert a[0] == 1234
   271 :         assert sys.getrefcount(a[0]) == 2
   272 :         assert a[0] == 123.0
   277 :         assert sys.getrefcount(a[0]) == 2
   278 :         assert a[0] == 'bubba'
   283 :         assert sys.getrefcount(a[0]) == 2
   284 :         assert a[0] == 'sissy'
   288 :         assert after1 == before1
   304 :         assert sys.getrefcount(a[1]) == 2
   305 :         assert a[1] == 1234
   310 :         assert sys.getrefcount(a[1]) == 2
   311 :         assert a[1] == 123.0
   316 :         assert sys.getrefcount(a[1]) == 2
   317 :         assert a[1] == 'bubba'
   322 :         assert sys.getrefcount(a[1]) == 2
   323 :         assert a[1] == 'sissy'
   327 :         assert after1 == before1
   338 :         assert sys.getrefcount(a[1]) == 2
   339 :         assert a[1] == 1234
   343 :         assert sys.getrefcount(a[1]) == 2
   344 :         assert a[1] == 123.0
   348 :         assert sys.getrefcount(a[1]) == 2
   349 :         assert a[1] == 'bubba'
   357 :         assert sys.getrefcount(a[1]) == 2
   358 :         assert a[1] == 'sissy'
   361 :         assert after1 == before1
   372 :         assert a == [1,2,3]
   374 :         assert sys.getrefcount(a) == 2
   383 :             assert 0
   394 :             assert 0
   424 :         assert b == desired
   450 :         assert b == desired

 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1197#comment:1>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list