From 7bf0564f87511d9e7b6287b3eec0857d0d7742df Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Wed, 4 Apr 2018 10:33:07 -0600 Subject: MAINT: Remove all uses of run_module_suite. That function is nose specific and has not worked since `__init__` files were added to the tests directories. --- numpy/lib/tests/test_polynomial.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'numpy/lib/tests/test_polynomial.py') diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py index 03915cead..1d7b8cbac 100644 --- a/numpy/lib/tests/test_polynomial.py +++ b/numpy/lib/tests/test_polynomial.py @@ -80,8 +80,8 @@ poly1d([ 2.]) ''' import numpy as np from numpy.testing import ( - run_module_suite, assert_, assert_equal, assert_array_equal, - assert_almost_equal, assert_array_almost_equal, assert_raises, rundocs + assert_, assert_equal, assert_array_equal, assert_almost_equal, + assert_array_almost_equal, assert_raises, rundocs ) @@ -243,7 +243,3 @@ class TestDocs(object): p.coeffs[2] += 10 assert_equal(p.coeffs, [1, 2, 3]) - - -if __name__ == "__main__": - run_module_suite() -- cgit v1.2.1 From 29405fdcc2545e8cf5227d019d5e5d4d8b28c032 Mon Sep 17 00:00:00 2001 From: mattip Date: Sun, 15 Apr 2018 12:28:07 +0300 Subject: TST: reactivate module docstring tests, fix float formatting --- numpy/lib/tests/test_polynomial.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'numpy/lib/tests/test_polynomial.py') diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py index 1d7b8cbac..7f6fca4a4 100644 --- a/numpy/lib/tests/test_polynomial.py +++ b/numpy/lib/tests/test_polynomial.py @@ -1,15 +1,13 @@ -from __future__ import division, absolute_import, print_function - ''' >>> p = np.poly1d([1.,2,3]) >>> p -poly1d([ 1., 2., 3.]) +poly1d([1., 2., 3.]) >>> print(p) 2 1 x + 2 x + 3 >>> q = np.poly1d([3.,2,1]) >>> q -poly1d([ 3., 2., 1.]) +poly1d([3., 2., 1.]) >>> print(q) 2 3 x + 2 x + 1 @@ -30,23 +28,23 @@ poly1d([ 3., 2., 1.]) 86.0 >>> p * q -poly1d([ 3., 8., 14., 8., 3.]) +poly1d([ 3., 8., 14., 8., 3.]) >>> p / q -(poly1d([ 0.33333333]), poly1d([ 1.33333333, 2.66666667])) +(poly1d([0.33333333]), poly1d([1.33333333, 2.66666667])) >>> p + q -poly1d([ 4., 4., 4.]) +poly1d([4., 4., 4.]) >>> p - q poly1d([-2., 0., 2.]) >>> p ** 4 -poly1d([ 1., 8., 36., 104., 214., 312., 324., 216., 81.]) +poly1d([ 1., 8., 36., 104., 214., 312., 324., 216., 81.]) >>> p(q) -poly1d([ 9., 12., 16., 8., 6.]) +poly1d([ 9., 12., 16., 8., 6.]) >>> q(p) -poly1d([ 3., 12., 32., 40., 34.]) +poly1d([ 3., 12., 32., 40., 34.]) >>> np.asarray(p) -array([ 1., 2., 3.]) +array([1., 2., 3.]) >>> len(p) 2 @@ -54,16 +52,16 @@ array([ 1., 2., 3.]) (3.0, 2.0, 1.0, 0) >>> p.integ() -poly1d([ 0.33333333, 1. , 3. , 0. ]) +poly1d([0.33333333, 1. , 3. , 0. ]) >>> p.integ(1) -poly1d([ 0.33333333, 1. , 3. , 0. ]) +poly1d([0.33333333, 1. , 3. , 0. ]) >>> p.integ(5) -poly1d([ 0.00039683, 0.00277778, 0.025 , 0. , 0. , - 0. , 0. , 0. ]) +poly1d([0.00039683, 0.00277778, 0.025 , 0. , 0. , + 0. , 0. , 0. ]) >>> p.deriv() -poly1d([ 2., 2.]) +poly1d([2., 2.]) >>> p.deriv(2) -poly1d([ 2.]) +poly1d([2.]) >>> q = np.poly1d([1.,2,3], variable='y') >>> print(q) @@ -75,9 +73,11 @@ poly1d([ 2.]) 1 lambda + 2 lambda + 3 >>> np.polydiv(np.poly1d([1,0,-1]), np.poly1d([1,1])) -(poly1d([ 1., -1.]), poly1d([ 0.])) +(poly1d([ 1., -1.]), poly1d([0.])) ''' +from __future__ import division, absolute_import, print_function + import numpy as np from numpy.testing import ( assert_, assert_equal, assert_array_equal, assert_almost_equal, -- cgit v1.2.1