Patchwork D8245: test: cleanly skip test-remotefilelog-datapack.py on policy that breaks it

login
register
mail settings
Submitter phabricator
Date March 7, 2020, 12:34 a.m.
Message ID <74674cd24eacba9d3f0c803c7e76a031@localhost.localdomain>
Download mbox | patch
Permalink /patch/45608/
State Not Applicable
Headers show

Comments

phabricator - March 7, 2020, 12:34 a.m.
Closed by commit rHGdca4b5da417d: test: cleanly skip test-remotefilelog-datapack.py on policy that breaks it (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8245?vs=20537&id=20607

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8245/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8245

AFFECTED FILES
  tests/test-remotefilelog-datapack.py

CHANGE DETAILS




To: marmoute, #hg-reviewers, Alphare
Cc: Alphare, mercurial-devel

Patch

diff --git a/tests/test-remotefilelog-datapack.py b/tests/test-remotefilelog-datapack.py
--- a/tests/test-remotefilelog-datapack.py
+++ b/tests/test-remotefilelog-datapack.py
@@ -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,