Mercurial > hg
diff tests/run-tests.py @ 32853:3139a7a1e7d4
tests: try and fail more gracefully with broken unicode escapes
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 15 Jun 2017 13:13:36 -0400 |
parents | 0cd641bfbf57 |
children | bd77ac2bd23a |
line wrap: on
line diff
--- a/tests/run-tests.py Thu Jun 15 12:49:13 2017 -0400 +++ b/tests/run-tests.py Thu Jun 15 13:13:36 2017 -0400 @@ -2093,13 +2093,17 @@ for tc, __ in testcases: if tc.name in timesd: diff = result.faildata.get(tc.name, b'') + try: + diff = diff.decode('unicode_escape') + except UnicodeDecodeError as e: + diff = '%r decoding diff, sorry' % e tres = {'result': res, 'time': ('%0.3f' % timesd[tc.name][2]), 'cuser': ('%0.3f' % timesd[tc.name][0]), 'csys': ('%0.3f' % timesd[tc.name][1]), 'start': ('%0.3f' % timesd[tc.name][3]), 'end': ('%0.3f' % timesd[tc.name][4]), - 'diff': diff.decode('unicode_escape'), + 'diff': diff, } else: # blacklisted test