Patchwork [3,of,4,v3] tests: skip demandimport if disabled

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

Comments

timeless - Aug. 25, 2016, 10:56 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1472162631 0
#      Thu Aug 25 22:03:51 2016 +0000
# Node ID cc14e6430ccb341393a74f7c52b48764907aa7ac
# Parent  e297cf7fe725843286758863deb5b8a005d2e887
# Available At https://bitbucket.org/timeless/mercurial-crew
#              hg pull https://bitbucket.org/timeless/mercurial-crew -r cc14e6430ccb
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 e297cf7fe725 -r cc14e6430ccb tests/test-demandimport.py
--- a/tests/test-demandimport.py	Thu Aug 25 22:30:35 2016 +0000
+++ b/tests/test-demandimport.py	Thu Aug 25 22:03:51 2016 +0000
@@ -4,6 +4,14 @@ 
 demandimport.enable()
 
 import os
+import subprocess
+import sys
+
+# Only run if demandimport is allowed
+if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'],
+                    'demandimport']):
+    sys.exit(80)
+
 if os.name != 'nt':
     try:
         import distutils.msvc9compiler