diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2006-04-04 06:11:39 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2006-04-04 06:11:39 +0000 |
commit | 163d94675ef2b4e37700c2293d800b858b698b4a (patch) | |
tree | 180cab8a8cb7697102ba7c8d99a2ca2026703111 /numpy/testing/numpytest.py | |
parent | 7c0eef63f9429ead37f628984de22177b08a5597 (diff) | |
download | numpy-163d94675ef2b4e37700c2293d800b858b698b4a.tar.gz |
Applied Bryce patch to support TestCase proxy classes.
Diffstat (limited to 'numpy/testing/numpytest.py')
-rw-r--r-- | numpy/testing/numpytest.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index 5b7ef9953..c9a255e55 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -139,10 +139,13 @@ class NumpyTestCase (unittest.TestCase): unittest.TestCase.__call__(self, result) if nof_errors != len(result.errors): test, errstr = result.errors[-1] - if type(errstr) is type(()): + if isinstance(errstr, tuple): errstr = str(errstr[0]) - else: + elif isinstance(errstr, str): errstr = errstr.split('\n')[-2] + else: + # allow for proxy classes + errstr = str(errstr).split('\n')[-2] l = len(result.stream.data) if errstr.startswith('IgnoreException:'): if l==1: |