changeset 29872:4b50e1f922a0

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...
author timeless <timeless@mozdev.org>
date Thu, 25 Aug 2016 22:03:51 +0000
parents b05a3a04f046
children 0a9cd6e324cd
files tests/test-demandimport.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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