summaryrefslogtreecommitdiff
path: root/numpy/polynomial/tests/test_polyutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial/tests/test_polyutils.py')
-rw-r--r--numpy/polynomial/tests/test_polyutils.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/numpy/polynomial/tests/test_polyutils.py b/numpy/polynomial/tests/test_polyutils.py
index 11b37aa1a..c77ee2435 100644
--- a/numpy/polynomial/tests/test_polyutils.py
+++ b/numpy/polynomial/tests/test_polyutils.py
@@ -7,30 +7,31 @@ import numpy as np
import numpy.polynomial.polyutils as pu
from numpy.testing import *
-class TestMisc(TestCase) :
- def test_trimseq(self) :
- for i in range(5) :
+class TestMisc(TestCase):
+
+ def test_trimseq(self):
+ for i in range(5):
tgt = [1]
res = pu.trimseq([1] + [0]*5)
assert_equal(res, tgt)
- def test_as_series(self) :
+ def test_as_series(self):
# check exceptions
assert_raises(ValueError, pu.as_series, [[]])
assert_raises(ValueError, pu.as_series, [[[1, 2]]])
assert_raises(ValueError, pu.as_series, [[1], ['a']])
# check common types
types = ['i', 'd', 'O']
- for i in range(len(types)) :
- for j in range(i) :
+ for i in range(len(types)):
+ for j in range(i):
ci = np.ones(1, types[i])
cj = np.ones(1, types[j])
[resi, resj] = pu.as_series([ci, cj])
assert_(resi.dtype.char == resj.dtype.char)
assert_(resj.dtype.char == types[i])
- def test_trimcoef(self) :
+ def test_trimcoef(self):
coef = [2, -1, 1, 0]
# Test exceptions
assert_raises(ValueError, pu.trimcoef, coef, -1)
@@ -40,9 +41,9 @@ class TestMisc(TestCase) :
assert_equal(pu.trimcoef(coef, 2), [0])
-class TestDomain(TestCase) :
+class TestDomain(TestCase):
- def test_getdomain(self) :
+ def test_getdomain(self):
# test for real values
x = [1, 10, 3, -1]
tgt = [-1, 10]
@@ -55,7 +56,7 @@ class TestDomain(TestCase) :
res = pu.getdomain(x)
assert_almost_equal(res, tgt)
- def test_mapdomain(self) :
+ def test_mapdomain(self):
# test for real values
dom1 = [0, 4]
dom2 = [1, 3]
@@ -86,7 +87,7 @@ class TestDomain(TestCase) :
res = pu.mapdomain(x, dom1, dom2)
assert_(isinstance(res, np.matrix))
- def test_mapparms(self) :
+ def test_mapparms(self):
# test for real values
dom1 = [0, 4]
dom2 = [1, 3]