diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-07-11 17:16:42 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-07-11 17:16:42 -0700 |
commit | a053a4372aba0af0bd63ffd5e207baf469cfc7bf (patch) | |
tree | afcdad0da5b29ce832528474246dcb66bc1491cf /numpy/lib/tests/test_function_base.py | |
parent | e1c4806b649933383fb610205fb612c438360472 (diff) | |
parent | 2f1174dee44e901b7d028beb86f4a8ea324bd74f (diff) | |
download | numpy-a053a4372aba0af0bd63ffd5e207baf469cfc7bf.tar.gz |
Merge pull request #3518 from charris/use-errstate-context-manager
MAINT: Use np.errstate context manager.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 45e248913..a23e406e3 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -1062,8 +1062,7 @@ class TestHistogramdd(TestCase): def test_inf_edges(self): """Test using +/-inf bin edges works. See #1788.""" - olderr = np.seterr(invalid='ignore') - try: + with np.errstate(invalid='ignore'): x = np.arange(6).reshape(3, 2) expected = np.array([[1, 0], [0, 1], [0, 1]]) h, e = np.histogramdd(x, bins=[3, [-np.inf, 2, 10]]) @@ -1072,8 +1071,6 @@ class TestHistogramdd(TestCase): assert_allclose(h, expected) h, e = np.histogramdd(x, bins=[3, [-np.inf, 3, np.inf]]) assert_allclose(h, expected) - finally: - np.seterr(**olderr) class TestUnique(TestCase): |