summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2009-12-04 13:22:24 +0000
committerTravis Oliphant <oliphant@enthought.com>2009-12-04 13:22:24 +0000
commitc0c266ea2e678dbb4f899d6f985f35b19fb88d08 (patch)
tree8f16db5550b20dd371fc7e130ab5ecebfb68ebf4 /numpy/testing/utils.py
parent914c498abefb4f65e160cdf6b030ff8efe8b975c (diff)
downloadnumpy-c0c266ea2e678dbb4f899d6f985f35b19fb88d08.tar.gz
Fix tests now that ufuncs raise NotImplementedError.
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r--numpy/testing/utils.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index 7c8e978e2..08cec9a8b 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -301,9 +301,7 @@ def assert_equal(actual,desired,err_msg='',verbose=True):
raise AssertionError(msg)
# If TypeError or ValueError raised while using isnan and co, just handle
# as before
- except TypeError:
- pass
- except ValueError:
+ except (TypeError, ValueError, NotImplementedError):
pass
if desired != actual :
raise AssertionError(msg)
@@ -453,7 +451,7 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True):
if not desired == actual:
raise AssertionError(msg)
return
- except TypeError:
+ except (NotImplementedError, TypeError):
pass
if round(abs(desired - actual),decimal) != 0 :
raise AssertionError(msg)
@@ -543,7 +541,7 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True):
if not desired == actual:
raise AssertionError(msg)
return
- except TypeError:
+ except (TypeError, NotImplementedError):
pass
if np.abs(sc_desired - sc_actual) >= np.power(10.,-(significant-1)) :
raise AssertionError(msg)
@@ -755,7 +753,7 @@ def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True):
return x == y
x = x[~xinfid]
y = y[~yinfid]
- except TypeError:
+ except (TypeError, NotImplementedError):
pass
z = abs(x-y)
if not issubdtype(z.dtype, number):