summaryrefslogtreecommitdiff
path: root/numpy/ma/tests/test_subclassing.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-07-11 17:16:42 -0700
committerCharles Harris <charlesr.harris@gmail.com>2013-07-11 17:16:42 -0700
commita053a4372aba0af0bd63ffd5e207baf469cfc7bf (patch)
treeafcdad0da5b29ce832528474246dcb66bc1491cf /numpy/ma/tests/test_subclassing.py
parente1c4806b649933383fb610205fb612c438360472 (diff)
parent2f1174dee44e901b7d028beb86f4a8ea324bd74f (diff)
downloadnumpy-a053a4372aba0af0bd63ffd5e207baf469cfc7bf.tar.gz
Merge pull request #3518 from charris/use-errstate-context-manager
MAINT: Use np.errstate context manager.
Diffstat (limited to 'numpy/ma/tests/test_subclassing.py')
-rw-r--r--numpy/ma/tests/test_subclassing.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/ma/tests/test_subclassing.py b/numpy/ma/tests/test_subclassing.py
index 54b202684..7014246d4 100644
--- a/numpy/ma/tests/test_subclassing.py
+++ b/numpy/ma/tests/test_subclassing.py
@@ -96,12 +96,9 @@ class TestSubclassing(TestCase):
def test_masked_unary_operations(self):
"Tests masked_unary_operation"
(x, mx) = self.data
- olderr = np.seterr(divide='ignore')
- try:
+ with np.errstate(divide='ignore'):
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"