summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_subclassing.py
diff options
context:
space:
mode:
authorrgommers <ralf.gommers@googlemail.com>2011-03-11 00:27:09 +0800
committerrgommers <ralf.gommers@googlemail.com>2011-03-11 08:44:45 +0800
commit46ce29dedb1005a78a8460eb0ccfd9025152b8da (patch)
tree83d6035aa89b2edf5f29374f1c3168770cd87253 /numpy/ma/tests/test_subclassing.py
parent9e28fce21a7bec4c9f1e8c686f63c57ea475c439 (diff)
downloadnumpy-46ce29dedb1005a78a8460eb0ccfd9025152b8da.tar.gz
TST: fix two divide-by-zero test warnings.
Diffstat (limited to 'numpy/ma/tests/test_subclassing.py')
-rw-r--r--numpy/ma/tests/test_subclassing.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/ma/tests/test_subclassing.py b/numpy/ma/tests/test_subclassing.py
index 146ea3051..fb72ca773 100644
--- a/numpy/ma/tests/test_subclassing.py
+++ b/numpy/ma/tests/test_subclassing.py
@@ -93,8 +93,12 @@ class TestSubclassing(TestCase):
def test_masked_unary_operations(self):
"Tests masked_unary_operation"
(x, mx) = self.data
- self.assertTrue(isinstance(log(mx), mmatrix))
- assert_equal(log(x), np.log(x))
+ olderr = np.seterr(divide='ignore')
+ try:
+ self.assertTrue(isinstance(log(mx), mmatrix))
+ assert_equal(log(x), np.log(x))
+ finally:
+ np.seterr(**olderr)
def test_masked_binary_operations(self):
"Tests masked_binary_operation"