Mercurial > hg
diff tests/test-demandimport.py @ 37964:1d0610fdd63b
tests: migrate demandimport.py away from deprecated `util` module symbols
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 11 May 2018 00:58:51 -0400 |
parents | c2c5f9f6fa21 |
children | dffd6a301570 |
line wrap: on
line diff
--- a/tests/test-demandimport.py Thu May 10 22:00:41 2018 -0400 +++ b/tests/test-demandimport.py Fri May 11 00:58:51 2018 -0400 @@ -58,12 +58,12 @@ print("os.system =", f(os.system)) print("os =", f(os)) -from mercurial import util +from mercurial.utils import procutil -print("util =", f(util)) -print("util.system =", f(util.system)) -print("util =", f(util)) -print("util.system =", f(util.system)) +print("procutil =", f(procutil)) +print("procutil.system =", f(procutil.system)) +print("procutil =", f(procutil)) +print("procutil.system =", f(procutil.system)) from mercurial import hgweb print("hgweb =", f(hgweb)) @@ -100,6 +100,8 @@ print('contextlib.unknownattr = ImportError: %s' % rsub(r"'", '', str(inst))) +from mercurial import util + # Unlike the import statement, __import__() function should not raise # ImportError even if fromlist has an unknown item # (see Python/import.c:import_module_level() and ensure_fromlist())