Skip to content

Commit

Permalink
Fix tests now that ufuncs raise NotImplementedError.
Browse files Browse the repository at this point in the history
  • Loading branch information
teoliphant committed Dec 4, 2009
1 parent 914c498 commit c0c266e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions numpy/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -755,7 +753,7 @@ def compare(x, y):
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):
Expand Down

0 comments on commit c0c266e

Please sign in to comment.