summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2012-02-20 22:20:48 +0100
committerRalf Gommers <ralf.gommers@googlemail.com>2012-03-02 20:07:37 +0100
commit955f471ed5034f772fa1eb1a86429a79e53ff541 (patch)
tree4a71013dd8219a9396c4cc6ec7ff3d4023151bca /numpy/lib/tests/test_function_base.py
parentda0054cf2086eddbe39dec79914df1ec722d53a4 (diff)
downloadnumpy-955f471ed5034f772fa1eb1a86429a79e53ff541.tar.gz
TST: filter RuntimeWarnings for invalids from some more test files.
This should fix the test errors seen on both MinGW and MSVC9 related to this.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index fc033b164..a7d501c52 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -784,14 +784,18 @@ class TestHistogramdd(TestCase):
def test_inf_edges(self):
"""Test using +/-inf bin edges works. See #1788."""
- 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]])
- assert_allclose(h, expected)
- h, e = np.histogramdd(x, bins=[3, np.array([-1, 2, np.inf])])
- assert_allclose(h, expected)
- h, e = np.histogramdd(x, bins=[3, [-np.inf, 3, np.inf]])
- assert_allclose(h, expected)
+ olderr = np.seterr(invalid='ignore')
+ try:
+ 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]])
+ assert_allclose(h, expected)
+ h, e = np.histogramdd(x, bins=[3, np.array([-1, 2, np.inf])])
+ 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):