diff tests/hghave.py @ 29820:7025693433b2

py3: have check-py3-compat require pygments to get stable result
author Yuya Nishihara <yuya@tcha.org>
date Wed, 17 Aug 2016 20:52:50 +0900
parents 94fb0458a791
children 00ca4f966ca6
line wrap: on
line diff
--- a/tests/hghave.py	Tue Aug 09 17:06:35 2016 +0200
+++ b/tests/hghave.py	Wed Aug 17 20:52:50 2016 +0900
@@ -544,6 +544,16 @@
 def has_python3exe():
     return 'PYTHON3' in os.environ
 
+@check("py3pygments", "Pygments available on Python 3.x")
+def has_py3pygments():
+    if has_py3k():
+        return has_pygments()
+    elif has_python3exe():
+        # just check exit status (ignoring output)
+        py3 = os.environ['PYTHON3']
+        return matchoutput('%s -c "import pygments"' % py3, br'')
+    return False
+
 @check("pure", "running with pure Python code")
 def has_pure():
     return any([