[PATCH 06 of 10 PyPy] test-demandimport: ensure that relative imports are deferred

Bryan O'Sullivan bos at serpentine.com
Wed Dec 23 18:22:21 CST 2015


This adds a test not just at our local "top level" (the mercurial
package), but also one level deeper (mercurial.hgweb).

diff --git a/tests/test-demandimport.py b/tests/test-demandimport.py
--- a/tests/test-demandimport.py
+++ b/tests/test-demandimport.py
@@ -34,6 +34,11 @@ print "util.system =", f(util.system)
 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)
 
diff --git a/tests/test-demandimport.py.out b/tests/test-demandimport.py.out
--- a/tests/test-demandimport.py.out
+++ b/tests/test-demandimport.py.out
@@ -5,6 +5,9 @@ util = <unloaded module 'util'>
 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'>


More information about the Mercurial-devel mailing list