Patchwork [3,of,3,v2] tests: guard demandimport segment of test-extension.t

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

Comments

timeless - Aug. 25, 2016, 10:42 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1472164568 0
#      Thu Aug 25 22:36:08 2016 +0000
# Node ID 11d46dd1373b72c7af47c0331f0e201c2b093526
# Parent  2122bf277e3ad68bd59d1d5cea79fea137b09c5a
# Available At https://bitbucket.org/timeless/mercurial-crew
#              hg pull https://bitbucket.org/timeless/mercurial-crew -r 11d46dd1373b
tests: guard demandimport segment of test-extension.t

Patch

diff -r 2122bf277e3a -r 11d46dd1373b tests/hghave.py
--- a/tests/hghave.py	Thu Aug 25 22:30:35 2016 +0000
+++ b/tests/hghave.py	Thu Aug 25 22:36:08 2016 +0000
@@ -102,6 +102,13 @@ 
     s = p.stdout.read()
     return (ignorestatus or not ret) and r.search(s)
 
+def ensuremercurial():
+    try:
+        from mercurial import __version__
+    except ImportError:
+        testdir = os.path.dirname(os.path.abspath(__file__))
+        sys.path.append(os.path.dirname(testdir))
+
 @check("baz", "GNU Arch baz client")
 def has_baz():
     return matchoutput('baz --version 2>&1', br'baz Bazaar version')
diff -r 2122bf277e3a -r 11d46dd1373b tests/test-extension.t
--- a/tests/test-extension.t	Thu Aug 25 22:30:35 2016 +0000
+++ b/tests/test-extension.t	Thu Aug 25 22:36:08 2016 +0000
@@ -249,7 +249,7 @@ 
   $TESTTMP/a (glob)
 #endif
 
-#if absimport
+#if demandimport absimport
 
 Examine whether module loading is delayed until actual refering, even
 though module is imported with "absolute_import" feature.