tests/hghave.py
changeset 44119 5b38c2ab6ad3
parent 43819 e8a3bbffdc7d
child 44264 d3f776c4760e
--- a/tests/hghave.py	Mon Jan 20 23:51:25 2020 -0800
+++ b/tests/hghave.py	Sat Jan 18 10:21:45 2020 -0800
@@ -577,6 +577,22 @@
         return False
 
 
+@check("pygments25", "Pygments version >= 2.5")
+def pygments25():
+    try:
+        import pygments
+
+        v = pygments.__version__
+    except ImportError:
+        return False
+
+    parts = v.split(".")
+    major = int(parts[0])
+    minor = int(parts[1])
+
+    return (major, minor) >= (2, 5)
+
+
 @check("outer-repo", "outer repo")
 def has_outer_repo():
     # failing for other reasons than 'no repo' imply that there is a repo