Mercurial > public > mercurial-scm > hg
comparison tests/test-run-tests.py @ 33710:2e43c5cd57a7
tests: fix up test-run-tests failures on Python 3.6
Some of the recent work on run-tests.py didn't work on Python 3. This
fixes the regressions.
Differential Revision: https://phab.mercurial-scm.org/D270
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 08 Aug 2017 15:07:05 -0400 |
parents | eeed23508383 |
children | 14fd435763ee |
comparison
equal
deleted
inserted
replaced
33709:511d6ae462f3 | 33710:2e43c5cd57a7 |
---|---|
37 """ | 37 """ |
38 assert (expected.endswith(b'\n') | 38 assert (expected.endswith(b'\n') |
39 and output.endswith(b'\n')), 'missing newline' | 39 and output.endswith(b'\n')), 'missing newline' |
40 assert not re.search(br'[^ \w\\/\r\n()*?]', expected + output), \ | 40 assert not re.search(br'[^ \w\\/\r\n()*?]', expected + output), \ |
41 b'single backslash or unknown char' | 41 b'single backslash or unknown char' |
42 test = run_tests.TTest('test-run-test.t', '.', '.') | 42 test = run_tests.TTest(b'test-run-test.t', b'.', b'.') |
43 match = test.linematch(expected, output) | 43 match = test.linematch(expected, output) |
44 if isinstance(match, str): | 44 if isinstance(match, str): |
45 return 'special: ' + match | 45 return 'special: ' + match |
46 elif isinstance(match, bytes): | 46 elif isinstance(match, bytes): |
47 return 'special: ' + match.decode('utf-8') | 47 return 'special: ' + match.decode('utf-8') |