diff options
-rw-r--r-- | numpy/core/tests/test_regression.py | 3 | ||||
-rw-r--r-- | numpy/linalg/tests/test_regression.py | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index b1d1673dd..5966ff688 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -139,7 +139,7 @@ class TestRegression(TestCase): b = np.linspace(0, 10, 11) # This should return true for now, but will eventually raise an error: with suppress_warnings() as sup: - sup.filter(DeprecationWarning) + sup.filter(FutureWarning) self.assertTrue(b != 'auto') self.assertTrue(b[0] != 'auto') @@ -813,6 +813,7 @@ class TestRegression(TestCase): # and the boolean special case is not taken. with suppress_warnings() as sup: sup.filter(DeprecationWarning) + sup.filter(FutureWarning) sup.filter(np.VisibleDeprecationWarning) self.assertRaises(IndexError, ia, x, s, np.zeros(9, dtype=float)) self.assertRaises(IndexError, ia, x, s, np.zeros(11, dtype=float)) diff --git a/numpy/linalg/tests/test_regression.py b/numpy/linalg/tests/test_regression.py index 6991628fb..d2080b709 100644 --- a/numpy/linalg/tests/test_regression.py +++ b/numpy/linalg/tests/test_regression.py @@ -2,6 +2,8 @@ """ from __future__ import division, absolute_import, print_function +import warnings + import numpy as np from numpy import linalg, arange, float64, array, dot, transpose from numpy.testing import ( @@ -110,8 +112,10 @@ class TestRegression(TestCase): self.assertRaises(ValueError, linalg.norm, testvector, ord='nuc') self.assertRaises(ValueError, linalg.norm, testvector, ord=np.inf) self.assertRaises(ValueError, linalg.norm, testvector, ord=-np.inf) - self.assertRaises((AttributeError, DeprecationWarning), - linalg.norm, testvector, ord=0) + with warnings.catch_warnings(): + warnings.simplefilter("error", DeprecationWarning) + self.assertRaises((AttributeError, DeprecationWarning), + linalg.norm, testvector, ord=0) self.assertRaises(ValueError, linalg.norm, testvector, ord=-1) self.assertRaises(ValueError, linalg.norm, testvector, ord=-2) |