##// END OF EJS Templates
run-tests: pass color option via test case object , not global var...
Martin von Zweigbergk -
r33565:0982d900 default
parent child Browse files
Show More
@@ -1564,16 +1564,12 b' class TestResult(unittest._TextTestResul'
1564 self.successes = []
1564 self.successes = []
1565 self.faildata = {}
1565 self.faildata = {}
1566
1566
1567 global with_color
1567 if options.color == 'auto':
1568 if not self.stream.isatty(): # check if the terminal is capable
1568 self.color = with_color and self.stream.isatty()
1569 with_color = False
1569 elif options.color == 'never':
1570
1570 self.color = False
1571 if options.color != 'auto':
1571 else: # 'always', for testing purposes
1572 if options.color == 'never':
1572 self.color = pygmentspresent
1573 with_color = False
1574 else: # 'always', for testing purposes
1575 if pygmentspresent:
1576 with_color = True
1577
1573
1578 def addFailure(self, test, reason):
1574 def addFailure(self, test, reason):
1579 self.failures.append((test, reason))
1575 self.failures.append((test, reason))
@@ -1652,7 +1648,7 b' class TestResult(unittest._TextTestResul'
1652 else:
1648 else:
1653 self.stream.write('\n')
1649 self.stream.write('\n')
1654 for line in lines:
1650 for line in lines:
1655 if with_color and pygmentspresent:
1651 if self.color and pygmentspresent:
1656 line = pygments.highlight(
1652 line = pygments.highlight(
1657 line,
1653 line,
1658 lexers.DiffLexer(),
1654 lexers.DiffLexer(),
General Comments 0
You need to be logged in to leave comments. Login now