--- a/tests/test-demandimport.py Thu Jan 04 16:29:07 2018 -0800
+++ b/tests/test-demandimport.py Fri Feb 16 11:30:18 2018 -0800
@@ -31,6 +31,16 @@
l = rsub("'<[a-z]*>'", "'<whatever>'", l)
return l
+demandimport.disable()
+os.environ['HGDEMANDIMPORT'] = 'disable'
+# this enable call should not actually enable demandimport!
+demandimport.enable()
+from mercurial import node
+print("node =", f(node))
+# now enable it for real
+del os.environ['HGDEMANDIMPORT']
+demandimport.enable()
+
import os
print("os =", f(os))
@@ -97,10 +107,3 @@
print("__import__('contextlib', ..., ['unknownattr']) =", f(contextlibimp))
print("hasattr(contextlibimp, 'unknownattr') =",
util.safehasattr(contextlibimp, 'unknownattr'))
-
-demandimport.disable()
-os.environ['HGDEMANDIMPORT'] = 'disable'
-# this enable call should not actually enable demandimport!
-demandimport.enable()
-from mercurial import node
-print("node =", f(node))