test-demandimport: ensure that relative imports are deferred
authorBryan O'Sullivan <bos@serpentine.com>
Wed, 23 Dec 2015 16:22:20 -0800
changeset 27535 0d0f4070f6d7
parent 27534 88b32dcc25b6
child 27536 f7d890bc5e01
test-demandimport: ensure that relative imports are deferred This adds a test not just at our local "top level" (the mercurial package), but also one level deeper (mercurial.hgweb).
tests/test-demandimport.py
tests/test-demandimport.py.out
--- a/tests/test-demandimport.py	Wed Dec 23 16:22:20 2015 -0800
+++ b/tests/test-demandimport.py	Wed Dec 23 16:22:20 2015 -0800
@@ -34,6 +34,11 @@
 print "util =", f(util)
 print "util.system =", f(util.system)
 
+from mercurial import hgweb
+print "hgweb =", f(hgweb)
+print "hgweb_mod =", f(hgweb.hgweb_mod)
+print "hgweb =", f(hgweb)
+
 import re as fred
 print "fred =", f(fred)
 
--- a/tests/test-demandimport.py.out	Wed Dec 23 16:22:20 2015 -0800
+++ b/tests/test-demandimport.py.out	Wed Dec 23 16:22:20 2015 -0800
@@ -5,6 +5,9 @@
 util.system = <function system at 0x?>
 util = <module 'mercurial.util' from '?'>
 util.system = <function system at 0x?>
+hgweb = <unloaded module 'hgweb'>
+hgweb_mod = <unloaded module 'hgweb_mod'>
+hgweb = <module 'mercurial.hgweb' from '?'>
 fred = <unloaded module 're'>
 re = <unloaded module 'sys'>
 fred = <unloaded module 're'>