summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-07-21 17:32:43 -0600
committerCharles Harris <charlesr.harris@gmail.com>2019-07-28 18:09:10 -0600
commitb6953301871f6fa8db0daa5c6187464af8faa9d5 (patch)
tree1c10a527ff4a1abc48cf3ae643be48a1a6a63c52
parent397a2998411fa7fbd546374cc5ceac3f962da434 (diff)
downloadnumpy-b6953301871f6fa8db0daa5c6187464af8faa9d5.tar.gz
MAINT: Print more informative message when test fails.
The Deprecation tests were only printing the warning type on failure, print the whole warning instead so that it is possible to know where the warnings originated.
-rw-r--r--numpy/core/tests/test_deprecations.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/tests/test_deprecations.py b/numpy/core/tests/test_deprecations.py
index 6d71fcbd6..58ebea024 100644
--- a/numpy/core/tests/test_deprecations.py
+++ b/numpy/core/tests/test_deprecations.py
@@ -101,7 +101,7 @@ class _DeprecationTestCase(object):
(self.warning_cls.__name__, warning.category))
if num is not None and num_found != num:
msg = "%i warnings found but %i expected." % (len(self.log), num)
- lst = [str(w.category) for w in self.log]
+ lst = [str(w) for w in self.log]
raise AssertionError("\n".join([msg] + lst))
with warnings.catch_warnings():