test: cleanly skip test-remotefilelog-datapack.py on policy that breaks it stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 06 Mar 2020 00:28:09 +0100
branchstable
changeset 44432 dca4b5da417d
parent 44431 b24721e7c5ee
child 44450 7d5455b988ec
test: cleanly skip test-remotefilelog-datapack.py on policy that breaks it That tests requires the pure module to be available. Differential Revision: https://phab.mercurial-scm.org/D8245
tests/test-remotefilelog-datapack.py
--- a/tests/test-remotefilelog-datapack.py	Thu Mar 05 09:26:45 2020 +0100
+++ b/tests/test-remotefilelog-datapack.py	Fri Mar 06 00:28:09 2020 +0100
@@ -17,6 +17,14 @@
 # Load the local remotefilelog, not the system one
 sys.path[0:0] = [os.path.join(os.path.dirname(__file__), '..')]
 from mercurial.node import nullid
+from mercurial import policy
+
+if not policy._packageprefs.get(policy.policy, (False, False))[1]:
+    if __name__ == '__main__':
+        msg = "skipped: pure module not available with module policy:"
+        print(msg, policy.policy, file=sys.stderr)
+        sys.exit(80)
+
 from mercurial import (
     pycompat,
     ui as uimod,