diff options
Diffstat (limited to 'numpy/polynomial/tests/test_classes.py')
-rw-r--r-- | numpy/polynomial/tests/test_classes.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/numpy/polynomial/tests/test_classes.py b/numpy/polynomial/tests/test_classes.py index 15e24f92b..91426cece 100644 --- a/numpy/polynomial/tests/test_classes.py +++ b/numpy/polynomial/tests/test_classes.py @@ -13,10 +13,10 @@ import numpy as np from numpy.polynomial import ( Polynomial, Legendre, Chebyshev, Laguerre, Hermite, HermiteE) from numpy.testing import ( - assert_almost_equal, assert_raises, assert_equal, assert_, + assert_almost_equal, assert_raises, assert_equal, assert_, assert_warns, ) from numpy.compat import long - +from numpy.polynomial.polyutils import RankWarning # # fixtures @@ -133,6 +133,16 @@ def test_fromroots(Poly): assert_almost_equal(p2.coef[-1], 1) +def test_bad_conditioned_fit(Poly): + + x = [0., 0., 1.] + y = [1., 2., 3.] + + # check RankWarning is raised + with assert_warns(RankWarning): + Poly.fit(x, y, 2) + + def test_fit(Poly): def f(x): |