diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -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 diff --git a/tests/test-highlight.t b/tests/test-highlight.t --- a/tests/test-highlight.t +++ b/tests/test-highlight.t @@ -184,7 +184,8 @@ except (ValueError, IndexError): n = 10 p = primes() - print("The first %d primes: %s" % (n, list(itertools.islice(p, n)))) + print("The first %d primes: %s" % (n, list(itertools.islice(p, n)))) (pygments25 !) + print("The first %d primes: %s" % (n, list(itertools.islice(p, n)))) (no-pygments25 !) @@ -845,7 +846,8 @@ changeset -