diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/unittest/case.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 644fe5b..0c23c96 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -689,7 +689,7 @@ class TestCase(object): if item1 != item2: differing += ('\nFirst differing element %d:\n%s\n%s\n' % - (i, item1, item2)) + (i, safe_repr(item1), safe_repr(item2))) break else: if (len1 == len2 and seq_type is None and @@ -702,7 +702,7 @@ class TestCase(object): 'elements.\n' % (seq_type_name, len1 - len2)) try: differing += ('First extra element %d:\n%s\n' % - (len2, seq1[len2])) + (len2, safe_repr(seq1[len2]))) except (TypeError, IndexError, NotImplementedError): differing += ('Unable to index element %d ' 'of first %s\n' % (len2, seq_type_name)) @@ -711,7 +711,7 @@ class TestCase(object): 'elements.\n' % (seq_type_name, len2 - len1)) try: differing += ('First extra element %d:\n%s\n' % - (len1, seq2[len1])) + (len1, safe_repr(seq2[len1]))) except (TypeError, IndexError, NotImplementedError): differing += ('Unable to index element %d ' 'of second %s\n' % (len1, seq_type_name)) |