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).
--- 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'>