diff options
-rw-r--r-- | numpy/testing/numpytest.py | 8 | ||||
-rw-r--r-- | numpy/testing/utils.py | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index a81a2519d..c07124753 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -150,10 +150,12 @@ class NumpyTestCase (unittest.TestCase): l = len(result.stream.data) if errstr.startswith('IgnoreException:'): if l==1: - assert result.stream.data[-1]=='E',`result.stream.data` + assert result.stream.data[-1]=='E', \ + repr(result.stream.data) result.stream.data[-1] = 'i' else: - assert result.stream.data[-1]=='ERROR\n',`result.stream.data` + assert result.stream.data[-1]=='ERROR\n', \ + repr(result.stream.data) result.stream.data[-1] = 'ignoring\n' del result.errors[-1] map(save_stream.write, result.stream.data) @@ -300,7 +302,7 @@ class NumpyTest: filename = module.__file__[-30:] if filename!=module.__file__: filename = '...'+filename - return '<module %s from %s>' % (`module.__name__`, `filename`) + return '<module %r from %r>' % (module.__name__, filename) def _get_method_names(self,clsobj,level): names = [] diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 15323854d..a38ea260d 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -123,10 +123,10 @@ def assert_equal(actual,desired,err_msg='',verbose=True): equal. I think this should be part of unittest.py """ if isinstance(desired, dict): - assert isinstance(actual, dict),`type(actual)` + assert isinstance(actual, dict), repr(type(actual)) assert_equal(len(actual),len(desired),err_msg,verbose) for k,i in desired.items(): - assert actual.has_key(k),`k` + assert actual.has_key(k), repr(k) assert_equal(actual[k], desired[k], 'key=%r\n%s' % (k,err_msg), verbose) return if isinstance(desired, (list,tuple)) and isinstance(actual, (list,tuple)): |