diff tests/hghave.py @ 31220:de48d3a0573a

hghave: add check for zstd support Not all configurations will support zstd. Add a check so we can conditionalize tests.
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 10 Nov 2016 23:38:41 -0800
parents d4db88a26ad5
children d83ca854fa21
line wrap: on
line diff
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -610,3 +610,12 @@
 @check("unziplinks", "unzip(1) understands and extracts symlinks")
 def unzip_understands_symlinks():
     return matchoutput('unzip --help', br'Info-ZIP')
+
+@check("zstd", "zstd Python module available")
+def has_zstd():
+    try:
+        import mercurial.zstd
+        mercurial.zstd.__version__
+        return True
+    except ImportError:
+        return False