diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-08-31 20:17:52 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-08-31 20:17:52 -0600 |
commit | 03371cdae281bbbde0c7adfc28d012d6555ad112 (patch) | |
tree | 186a6ae2a10fd1681e026e4b5c375d61b94005a7 /numpy/lib/tests/test_function_base.py | |
parent | 74b6b2cf151c4e869c35e2d226f0d6b69ea9d330 (diff) | |
download | numpy-03371cdae281bbbde0c7adfc28d012d6555ad112.tar.gz |
BUG: Make DeprecationWarning always raise error in test.
The test_fancy in numpy/lib/tests/test_function_base.py failed in
release because a DeprecationWarning was no longer raised, it had
become a warning.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 28f094653..360b6ab66 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -395,10 +395,12 @@ class TestDelete(TestCase): def test_fancy(self): # Deprecation/FutureWarning tests should be kept after change. self._check_inverse_of_slicing(np.array([[0, 1], [2, 1]])) - assert_raises(DeprecationWarning, delete, self.a, [100]) - assert_raises(DeprecationWarning, delete, self.a, [-100]) + with warnings.catch_warnings(): + warnings.filterwarnings('error', category=DeprecationWarning) + assert_raises(DeprecationWarning, delete, self.a, [100]) + assert_raises(DeprecationWarning, delete, self.a, [-100]) with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings('always', '', FutureWarning) + warnings.filterwarnings('always', category=FutureWarning) self._check_inverse_of_slicing([0, -1, 2, 2]) obj = np.array([True, False, False], dtype=bool) self._check_inverse_of_slicing(obj) |