diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -416,12 +416,12 @@ parser.error('--chg does not work when --with-hg is specified ' '(use --with-chg instead)') - global with_color - if options.color != 'auto': - if options.color == 'never': - with_color = False - else: # 'always', for testing purposes - with_color = True + if options.color == 'auto': + options.color = with_color + elif options.color == 'never': + options.color = False + else: # 'always', for testing purposes + options.color = True global useipv6 if options.ipv6: @@ -1651,7 +1651,7 @@ else: self.stream.write('\n') for line in lines: - if with_color and pygmentspresent: + if self._options.color and pygmentspresent: line = pygments.highlight( line, lexers.DiffLexer(),