[PATCH 1 of 5 stable] tests: avoid using black >= 21

Mads Kiilerich mads at kiilerich.com
Wed Mar 22 16:24:57 UTC 2023


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1679416596 -3600
#      Tue Mar 21 17:36:36 2023 +0100
# Branch stable
# Node ID 34c33da95b1aede3c9e63d1508570e2d8c620d9c
# Parent  4be9ecc982e19362747497276fa0841941787d08
tests: avoid using black >= 21

Different formatting will make test-check-format.t fail.

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -1115,7 +1115,9 @@ def has_black():
     version_regex = b'black, (?:version )?([0-9a-b.]+)'
     version = matchoutput(blackcmd, version_regex)
     sv = distutils.version.StrictVersion
-    return version and sv(_bytes2sys(version.group(1))) >= sv('20.8b1')
+    return version and (
+        sv('20.8b1') <= sv(_bytes2sys(version.group(1))) < sv('21.0')
+    )
 
 
 @check('pytype', 'the pytype type checker')



More information about the Mercurial-devel mailing list