diff tests/hghave.py @ 49951:42baf12efd21 stable

tests: pygments 2.14+ highlight whitespace in python code
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 25 Jan 2023 19:25:42 +0400
parents a2356e15200a
children 5df6d4f06a8f
line wrap: on
line diff
--- a/tests/hghave.py	Wed Jan 25 18:54:17 2023 +0400
+++ b/tests/hghave.py	Wed Jan 25 19:25:42 2023 +0400
@@ -693,6 +693,22 @@
     return (major, minor) >= (2, 11)
 
 
+@check("pygments214", "Pygments version >= 2.14")
+def pygments214():
+    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, 14)
+
+
 @check("outer-repo", "outer repo")
 def has_outer_repo():
     # failing for other reasons than 'no repo' imply that there is a repo