summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/utils.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2019-12-26 07:21:59 +0100
committerRalf Gommers <ralf.gommers@gmail.com>2019-12-26 07:21:59 +0100
commit48089a72d6f4c3805ce0a53618cc9652287c5018 (patch)
tree599b7df40d239c156d22f3b035d5c2a683176842 /numpy/testing/_private/utils.py
parent8bc83b5fdcbd17ed2bc6de6e0903c19ca94f8797 (diff)
downloadnumpy-48089a72d6f4c3805ce0a53618cc9652287c5018.tar.gz
TST: improve assert message of assert_array_max_ulp
It was not showing the max difference before, which makes it hard to judge whether something is seriously wrong, or the test precision simply needs to be bumped by a little.
Diffstat (limited to 'numpy/testing/_private/utils.py')
-rw-r--r--numpy/testing/_private/utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index 23267a9e1..870671d05 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -1636,8 +1636,9 @@ def assert_array_max_ulp(a, b, maxulp=1, dtype=None):
import numpy as np
ret = nulp_diff(a, b, dtype)
if not np.all(ret <= maxulp):
- raise AssertionError("Arrays are not almost equal up to %g ULP" %
- maxulp)
+ raise AssertionError("Arrays are not almost equal up to %g "
+ "ULP (max difference is %g ULP)" %
+ (maxulp, np.max(ret)))
return ret