summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_umath_complex.py8
-rw-r--r--numpy/ma/tests/test_subclassing.py8
2 files changed, 12 insertions, 4 deletions
diff --git a/numpy/core/tests/test_umath_complex.py b/numpy/core/tests/test_umath_complex.py
index 7f964e57e..619e6f0a3 100644
--- a/numpy/core/tests/test_umath_complex.py
+++ b/numpy/core/tests/test_umath_complex.py
@@ -12,8 +12,12 @@ import numpy as np
# At least on Windows the results of many complex functions are not conforming
# to the C99 standard. See ticket 1574.
# Ditto for Solaris (ticket 1642).
-functions_seem_flaky = ((np.exp(complex(np.inf, 0)).imag != 0)
- or (np.log(complex(np.NZERO, 0)).imag != np.pi))
+olderr = np.seterr(divide='ignore')
+try:
+ functions_seem_flaky = ((np.exp(complex(np.inf, 0)).imag != 0)
+ or (np.log(complex(np.NZERO, 0)).imag != np.pi))
+finally:
+ np.seterr(**olderr)
# TODO: replace with a check on whether platform-provided C99 funcs are used
have_platform_functions = (sys.platform.startswith('win')
or sys.platform.startswith('sunos')
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"