From patchwork Thu Aug 25 23:09:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,4,v4] tests: skip demandimport if disabled From: timeless X-Patchwork-Id: 16434 Message-Id: <238d7a96b8652f4ee639.1472166591@gcc2-power8.osuosl.org> To: mercurial-devel@mercurial-scm.org Date: Thu, 25 Aug 2016 23:09:51 +0000 # HG changeset patch # User timeless # Date 1472162631 0 # Thu Aug 25 22:03:51 2016 +0000 # Node ID 238d7a96b8652f4ee63946eb680303070ffebfbf # Parent 742a98771290ee1dbeb069a32ae592a72a5a8007 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 238d7a96b865 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... diff -r 742a98771290 -r 238d7a96b865 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