# HG changeset patch # User Gregory Szorc # Date 2016-11-11 07:38:41 # Node ID de48d3a0573aab57a2b65045f601a3cb47d1ff39 # Parent c3944ab1443a0a8872a5e9ca48b21ea973cf6f90 hghave: add check for zstd support Not all configurations will support zstd. Add a check so we can conditionalize tests. diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -610,3 +610,12 @@ def has_hypothesis(): @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