diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-09-03 05:55:28 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-09-03 15:03:41 -0600 |
commit | 8255df3d6cd00281f1f9b2925648dca3a0b9e036 (patch) | |
tree | 02ddc8134074f45b4a24e7b3abf4294ca29e8a6b /numpy/polynomial/tests/test_polyutils.py | |
parent | 294dd26004fa923a06e0898c2b72350dd44a97dd (diff) | |
download | numpy-8255df3d6cd00281f1f9b2925648dca3a0b9e036.tar.gz |
STY: Make numpy/polynomial/tests/*.py PEP8 compliant.
Run autopep8 on the tests and fixup the results.
Diffstat (limited to 'numpy/polynomial/tests/test_polyutils.py')
-rw-r--r-- | numpy/polynomial/tests/test_polyutils.py | 23 |
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] |