summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2012-03-02 20:24:45 +0100
committerRalf Gommers <ralf.gommers@googlemail.com>2012-03-02 20:25:02 +0100
commitb9872b41422e33c9910829cd54268a510ec9436b (patch)
tree33168c591f5186f521bb1c21ae3de73642d7f0e1 /numpy/lib/tests/test_function_base.py
parentba40918d39c8e0c41a6bffac67d2d74dd335161f (diff)
parente962f6b0be32515d6a1d9fb25d24ca250d632a4c (diff)
downloadnumpy-b9872b41422e33c9910829cd54268a510ec9436b.tar.gz
Merge pull request #215 from rgommers/windows-runtime-warnings.
This PR fixes a number of warnings, that were converted to test errors in master. Some of them were only visible with MSVC.
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):