summaryrefslogtreecommitdiff
path: root/numpy/linalg/tests/test_regression.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-09-02 09:11:59 -0500
committerGitHub <noreply@github.com>2016-09-02 09:11:59 -0500
commit9164f23c19c049e28d4d4825a53bbb01aedabcfc (patch)
treef017b7eb7565690a755263df12c835d61e89a8a4 /numpy/linalg/tests/test_regression.py
parent8eedd3e911b7e3f5f35961871ddb8ee1559d4225 (diff)
parent514d13679a55a82a96689679002c4ddc514641ce (diff)
downloadnumpy-9164f23c19c049e28d4d4825a53bbb01aedabcfc.tar.gz
Merge pull request #7099 from seberg/suppressed_warnings
Suppressed warnings
Diffstat (limited to 'numpy/linalg/tests/test_regression.py')
-rw-r--r--numpy/linalg/tests/test_regression.py8
1 files changed, 6 insertions, 2 deletions
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)