Patchwork tests: skip demandimport if disabled

login
register
mail settings
Submitter timeless
Date Aug. 25, 2016, 10:07 p.m.
Message ID <d240f3e2d0d3f2be06ca.1472162871@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/16424/
State Superseded
Headers show

Comments

timeless - Aug. 25, 2016, 10:07 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1472162631 0
#      Thu Aug 25 22:03:51 2016 +0000
# Node ID d240f3e2d0d3f2be06ca5a7b04fa4b6d99e695ff
# Parent  b1809f5d7630a3fff0fa715bbd30dba0f07672a8
# Available At https://bitbucket.org/timeless/mercurial-crew
#              hg pull https://bitbucket.org/timeless/mercurial-crew -r d240f3e2d0d3
tests: skip demandimport if disabled

demandimport and setuptools and decorator (from ironpython) and
pygments leads to lots of fail.

If demandimport is disabled we should skip testing it...

Patch

diff -r b1809f5d7630 -r d240f3e2d0d3 tests/test-demandimport.py
--- a/tests/test-demandimport.py	Mon Aug 15 20:39:33 2016 -0700
+++ b/tests/test-demandimport.py	Thu Aug 25 22:03:51 2016 +0000
@@ -4,6 +4,11 @@ 
 demandimport.enable()
 
 import os
+
+# Only run if demandimport is allowed
+if os.environ['HGDEMANDIMPORT'] == 'disable':
+    exit(80)
+
 if os.name != 'nt':
     try:
         import distutils.msvc9compiler