summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r--numpy/testing/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index eae343304..7753427c0 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -634,7 +634,10 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
if not cond :
raise AssertionError(msg)
except ValueError, e:
- header = 'error during assertion:\n%s\n\n%s' % (e, header)
+ import traceback
+ efmt = traceback.format_exc()
+ header = 'error during assertion:\n\n%s\n\n%s' % (efmt, header)
+
msg = build_err_msg([x, y], err_msg, verbose=verbose, header=header,
names=('x', 'y'))
raise ValueError(msg)