changeset 27535:0d0f4070f6d7

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).
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 23 Dec 2015 16:22:20 -0800
parents 88b32dcc25b6
children f7d890bc5e01
files tests/test-demandimport.py tests/test-demandimport.py.out
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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'>