summaryrefslogtreecommitdiff
path: root/numpy/polynomial/tests/test_legendre.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial/tests/test_legendre.py')
-rw-r--r--numpy/polynomial/tests/test_legendre.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/numpy/polynomial/tests/test_legendre.py b/numpy/polynomial/tests/test_legendre.py
index 485bc9688..375f41d49 100644
--- a/numpy/polynomial/tests/test_legendre.py
+++ b/numpy/polynomial/tests/test_legendre.py
@@ -7,8 +7,9 @@ import numpy as np
import numpy.polynomial.legendre as leg
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
- TestCase, assert_almost_equal, assert_raises,
- assert_equal, assert_, run_module_suite)
+ assert_almost_equal, assert_raises, assert_equal, assert_,
+ run_module_suite
+ )
L0 = np.array([1])
L1 = np.array([0, 1])
@@ -28,7 +29,7 @@ def trim(x):
return leg.legtrim(x, tol=1e-6)
-class TestConstants(TestCase):
+class TestConstants(object):
def test_legdomain(self):
assert_equal(leg.legdomain, [-1, 1])
@@ -43,7 +44,7 @@ class TestConstants(TestCase):
assert_equal(leg.legx, [0, 1])
-class TestArithmetic(TestCase):
+class TestArithmetic(object):
x = np.linspace(-1, 1, 100)
def test_legadd(self):
@@ -101,7 +102,7 @@ class TestArithmetic(TestCase):
assert_equal(trim(res), trim(tgt), err_msg=msg)
-class TestEvaluation(TestCase):
+class TestEvaluation(object):
# coefficients of 1 + 2*x + 3*x**2
c1d = np.array([2., 2., 2.])
c2d = np.einsum('i,j->ij', c1d, c1d)
@@ -195,7 +196,7 @@ class TestEvaluation(TestCase):
assert_(res.shape == (2, 3)*3)
-class TestIntegral(TestCase):
+class TestIntegral(object):
def test_legint(self):
# check exceptions
@@ -294,7 +295,7 @@ class TestIntegral(TestCase):
assert_almost_equal(res, tgt)
-class TestDerivative(TestCase):
+class TestDerivative(object):
def test_legder(self):
# check exceptions
@@ -334,7 +335,7 @@ class TestDerivative(TestCase):
assert_almost_equal(res, tgt)
-class TestVander(TestCase):
+class TestVander(object):
# some random values in [-1, 1)
x = np.random.random((3, 5))*2 - 1
@@ -382,7 +383,7 @@ class TestVander(TestCase):
assert_(van.shape == (1, 5, 24))
-class TestFitting(TestCase):
+class TestFitting(object):
def test_legfit(self):
def f(x):
@@ -459,7 +460,7 @@ class TestFitting(TestCase):
assert_almost_equal(coef1, coef2)
-class TestCompanion(TestCase):
+class TestCompanion(object):
def test_raises(self):
assert_raises(ValueError, leg.legcompanion, [])
@@ -474,7 +475,7 @@ class TestCompanion(TestCase):
assert_(leg.legcompanion([1, 2])[0, 0] == -.5)
-class TestGauss(TestCase):
+class TestGauss(object):
def test_100(self):
x, w = leg.leggauss(100)
@@ -493,7 +494,7 @@ class TestGauss(TestCase):
assert_almost_equal(w.sum(), tgt)
-class TestMisc(TestCase):
+class TestMisc(object):
def test_legfromroots(self):
res = leg.legfromroots([])