run-tests: warn if --color=always and no pygments installed
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 17 Jul 2017 16:27:13 -0700
changeset 33567 d9677e2ed16a
parent 33566 97070cbf0813
child 33568 a2c35146596b
run-tests: warn if --color=always and no pygments installed Differential Revision: https://phab.mercurial-scm.org/D117
tests/run-tests.py
--- a/tests/run-tests.py	Mon Jul 17 16:28:42 2017 -0700
+++ b/tests/run-tests.py	Mon Jul 17 16:27:13 2017 -0700
@@ -413,6 +413,10 @@
         parser.error('--chg does not work when --with-hg is specified '
                      '(use --with-chg instead)')
 
+    if options.color == 'always' and not pygmentspresent:
+        sys.stderr.write('warning: --color=always ignored because '
+                         'pygments is not installed\n')
+
     global useipv6
     if options.ipv6:
         useipv6 = checksocketfamily('AF_INET6')