##// 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 if sys.version_info > (3, 5, 0):
142 if sys.version_info > (3, 5, 0):
140 PYTHON3 = True
143 PYTHON3 = True
141 xrange = range # we use xrange in one place, and we'd rather not use range
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 if self.color:
1640 if self.color:
1638 formatted = pygments.highlight(
1641 formatted = pygments.highlight(
1639 formatted,
1642 formatted,
1640 TestRunnerLexer(),
1643 runnerlexer,
1641 formatters.Terminal256Formatter(
1644 runnerformatter)
1642 style=TestRunnerStyle))
1643 self.stream.write(formatted)
1645 self.stream.write(formatted)
1644 self.stream.write('!')
1646 self.stream.write('!')
1645
1647
@@ -2046,18 +2048,16 b' class TextTestRunner(unittest.TextTestRu'
2046 if result.color:
2048 if result.color:
2047 formatted = pygments.highlight(
2049 formatted = pygments.highlight(
2048 formatted,
2050 formatted,
2049 TestRunnerLexer(),
2051 runnerlexer,
2050 formatters.Terminal256Formatter(
2052 runnerformatter).strip("\n")
2051 style=TestRunnerStyle)).strip("\n")
2052 self.stream.writeln(formatted)
2053 self.stream.writeln(formatted)
2053 for test, msg in result.failures:
2054 for test, msg in result.failures:
2054 formatted = 'Failed %s: %s' % (test.name, msg)
2055 formatted = 'Failed %s: %s' % (test.name, msg)
2055 if result.color:
2056 if result.color:
2056 formatted = pygments.highlight(
2057 formatted = pygments.highlight(
2057 formatted,
2058 formatted,
2058 TestRunnerLexer(),
2059 runnerlexer,
2059 formatters.Terminal256Formatter(
2060 runnerformatter).strip("\n")
2060 style=TestRunnerStyle)).strip("\n")
2061 self.stream.writeln(formatted)
2061 self.stream.writeln(formatted)
2062 for test, msg in result.errors:
2062 for test, msg in result.errors:
2063 self.stream.writeln('Errored %s: %s' % (test.name, msg))
2063 self.stream.writeln('Errored %s: %s' % (test.name, msg))
General Comments 0
You need to be logged in to leave comments. Login now