diff options
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r-- | numpy/testing/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index a38ea260d..98e1c2a26 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -114,7 +114,9 @@ def build_err_msg(arrays, err_msg, header='Items are not equal:', r = repr(a) except: r = '[repr failed]' - r = r[:100] + if r.count('\n') > 3: + r = '\n'.join(r.splitlines()[:3]) + r += '...' msg.append(' %s: %s' % (names[i], r)) return '\n'.join(msg) |