Mercurial > hg
comparison tests/run-tests.py @ 33929:5d2ce90c71f1
run-tests: include "\n" in formatted message instead of calling writeln()
So we don't have to strip "\n" from pygments output.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 24 Aug 2017 22:09:57 +0900 |
parents | 9e8b01d0654f |
children | f5d4bb8e944d |
comparison
equal
deleted
inserted
replaced
33928:6c119dbfd0c0 | 33929:5d2ce90c71f1 |
---|---|
2041 with iolock: | 2041 with iolock: |
2042 self.stream.writeln('') | 2042 self.stream.writeln('') |
2043 | 2043 |
2044 if not self._runner.options.noskips: | 2044 if not self._runner.options.noskips: |
2045 for test, msg in result.skipped: | 2045 for test, msg in result.skipped: |
2046 formatted = 'Skipped %s: %s' % (test.name, msg) | 2046 formatted = 'Skipped %s: %s\n' % (test.name, msg) |
2047 if result.color: | 2047 if result.color: |
2048 formatted = pygments.highlight( | 2048 formatted = pygments.highlight( |
2049 formatted, | 2049 formatted, |
2050 runnerlexer, | 2050 runnerlexer, |
2051 runnerformatter).strip("\n") | 2051 runnerformatter) |
2052 self.stream.writeln(formatted) | 2052 self.stream.write(formatted) |
2053 for test, msg in result.failures: | 2053 for test, msg in result.failures: |
2054 formatted = 'Failed %s: %s' % (test.name, msg) | 2054 formatted = 'Failed %s: %s\n' % (test.name, msg) |
2055 if result.color: | 2055 if result.color: |
2056 formatted = pygments.highlight( | 2056 formatted = pygments.highlight( |
2057 formatted, | 2057 formatted, |
2058 runnerlexer, | 2058 runnerlexer, |
2059 runnerformatter).strip("\n") | 2059 runnerformatter) |
2060 self.stream.writeln(formatted) | 2060 self.stream.write(formatted) |
2061 for test, msg in result.errors: | 2061 for test, msg in result.errors: |
2062 self.stream.writeln('Errored %s: %s' % (test.name, msg)) | 2062 self.stream.writeln('Errored %s: %s' % (test.name, msg)) |
2063 | 2063 |
2064 if self._runner.options.xunit: | 2064 if self._runner.options.xunit: |
2065 with open(self._runner.options.xunit, "wb") as xuf: | 2065 with open(self._runner.options.xunit, "wb") as xuf: |