summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/utils.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2020-01-02 09:26:11 -0700
committerGitHub <noreply@github.com>2020-01-02 09:26:11 -0700
commitbcb6a445c0f30eebf80529be606c2b511e8e2bb3 (patch)
tree0aab36b4ff5e2244a574b4cbb0cbbdc30a1c5ad6 /numpy/testing/_private/utils.py
parent33d5be08046c2e8a3cbbd35f3c2367f925ee2bdc (diff)
parent48089a72d6f4c3805ce0a53618cc9652287c5018 (diff)
downloadnumpy-bcb6a445c0f30eebf80529be606c2b511e8e2bb3.tar.gz
Merge pull request #15178 from rgommers/maxulp-msg
TST: improve assert message of assert_array_max_ulp
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 94bad4f63..a3bd6d7a5 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