Skip to content

Commit

Permalink
Fix unumpy test to account for new behavior of numpy 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Aug 1, 2019
1 parent 8f301bf commit 293a027
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions uncertainties/unumpy/test_unumpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ def test_numpy():
# Equivalent with an array of AffineScalarFunc objects:
try:
numpy.exp(arr + ufloat(0, 0))
except AttributeError:
pass # ! This is usual (but could be avoided)
except (AttributeError, TypeError):
# In numpy<1.17, an AttributeError is raised in this situation. This was
# considered a bug however, and in numpy 1.17 it was changed to a
# TypeError (see PR #12700 in numpy repository)
pass
else:
raise Exception("numpy.exp unexpectedly worked")

Expand Down

0 comments on commit 293a027

Please sign in to comment.