[Scipy-svn] r6789 - trunk/scipy/integrate/tests

scipy-svn@scip... scipy-svn@scip...
Sun Sep 12 16:17:28 CDT 2010


Author: warren.weckesser
Date: 2010-09-12 16:17:28 -0500 (Sun, 12 Sep 2010)
New Revision: 6789

Modified:
   trunk/scipy/integrate/tests/test_integrate.py
   trunk/scipy/integrate/tests/test_quadpack.py
Log:
TST: integrate: Don't use plain 'assert'.

Modified: trunk/scipy/integrate/tests/test_integrate.py
===================================================================
--- trunk/scipy/integrate/tests/test_integrate.py	2010-09-12 21:16:34 UTC (rev 6788)
+++ trunk/scipy/integrate/tests/test_integrate.py	2010-09-12 21:17:28 UTC (rev 6789)
@@ -7,7 +7,7 @@
 from numpy import arange, zeros, array, dot, sqrt, cos, sin, eye, pi, exp, \
                   allclose
 
-from numpy.testing import TestCase, run_module_suite
+from numpy.testing import assert_, TestCase, run_module_suite
 from scipy.integrate import odeint, ode, complex_ode
 
 #------------------------------------------------------------------------------
@@ -21,7 +21,7 @@
     def _do_problem(self, problem):
         t = arange(0.0, problem.stop_t, 0.05)
         z, infodict = odeint(problem.f, problem.z0, t, full_output=True)
-        assert problem.verify(z, t)
+        assert_(problem.verify(z, t))
 
     def test_odeint(self):
         for problem_cls in PROBLEMS:
@@ -49,8 +49,8 @@
         ig.set_initial_value(problem.z0, t=0.0)
         z = ig.integrate(problem.stop_t)
 
-        assert ig.successful(), (problem, method)
-        assert problem.verify(array([z]), problem.stop_t), (problem, method)
+        assert_(ig.successful(), (problem, method))
+        assert_(problem.verify(array([z]), problem.stop_t), (problem, method))
 
     def test_vode(self):
         """Check the vode solver"""
@@ -106,8 +106,8 @@
         ig.set_initial_value(problem.z0, t=0.0)
         z = ig.integrate(problem.stop_t)
 
-        assert ig.successful(), (problem, method)
-        assert problem.verify(array([z]), problem.stop_t), (problem, method)
+        assert_(ig.successful(), (problem, method))
+        assert_(problem.verify(array([z]), problem.stop_t), (problem, method))
 
     def test_vode(self):
         """Check the vode solver"""

Modified: trunk/scipy/integrate/tests/test_quadpack.py
===================================================================
--- trunk/scipy/integrate/tests/test_quadpack.py	2010-09-12 21:16:34 UTC (rev 6788)
+++ trunk/scipy/integrate/tests/test_quadpack.py	2010-09-12 21:17:28 UTC (rev 6789)
@@ -1,11 +1,11 @@
 from numpy import sqrt, cos, sin, arctan, exp, log, pi, Inf
-from numpy.testing import TestCase, run_module_suite
+from numpy.testing import assert_, TestCase, run_module_suite
 from scipy.integrate import quad, dblquad, tplquad
 
 def assert_quad((value, err), tabledValue, errTol=1.5e-8):
-    assert abs(value-tabledValue) < err, (value, tabledValue, err)
+    assert_(abs(value-tabledValue) < err, (value, tabledValue, err))
     if errTol is not None:
-        assert err < errTol, (err, errTol)
+        assert_(err < errTol, (err, errTol))
 
 class TestQuad(TestCase):
     def test_typical(self):



More information about the Scipy-svn mailing list