##// END OF EJS Templates
run-tests: pre instantiate pygments objects...
Matthieu Laneuville -
r33868:4e8a46c2 default
parent child Browse files
Show More
@@ -136,6 +136,9 b' if pygmentspresent:'
136 136 ]
137 137 }
138 138
139 runnerformatter = formatters.Terminal256Formatter(style=TestRunnerStyle)
140 runnerlexer = TestRunnerLexer()
141
139 142 if sys.version_info > (3, 5, 0):
140 143 PYTHON3 = True
141 144 xrange = range # we use xrange in one place, and we'd rather not use range
@@ -1637,9 +1640,8 b' class TestResult(unittest._TextTestResul'
1637 1640 if self.color:
1638 1641 formatted = pygments.highlight(
1639 1642 formatted,
1640 TestRunnerLexer(),
1641 formatters.Terminal256Formatter(
1642 style=TestRunnerStyle))
1643 runnerlexer,
1644 runnerformatter)
1643 1645 self.stream.write(formatted)
1644 1646 self.stream.write('!')
1645 1647
@@ -2046,18 +2048,16 b' class TextTestRunner(unittest.TextTestRu'
2046 2048 if result.color:
2047 2049 formatted = pygments.highlight(
2048 2050 formatted,
2049 TestRunnerLexer(),
2050 formatters.Terminal256Formatter(
2051 style=TestRunnerStyle)).strip("\n")
2051 runnerlexer,
2052 runnerformatter).strip("\n")
2052 2053 self.stream.writeln(formatted)
2053 2054 for test, msg in result.failures:
2054 2055 formatted = 'Failed %s: %s' % (test.name, msg)
2055 2056 if result.color:
2056 2057 formatted = pygments.highlight(
2057 2058 formatted,
2058 TestRunnerLexer(),
2059 formatters.Terminal256Formatter(
2060 style=TestRunnerStyle)).strip("\n")
2059 runnerlexer,
2060 runnerformatter).strip("\n")
2061 2061 self.stream.writeln(formatted)
2062 2062 for test, msg in result.errors:
2063 2063 self.stream.writeln('Errored %s: %s' % (test.name, msg))
General Comments 0
You need to be logged in to leave comments. Login now