Mercurial > hg-stable
changeset 38008: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 | 009b424c9cb6 |
children | 70f45f28c04e |
files | tests/test-demandimport.py tests/test-demandimport.py.out |
diffstat | 2 files changed, 11 insertions(+), 9 deletions(-) [+] |
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())
--- a/tests/test-demandimport.py.out Thu May 10 22:00:41 2018 -0400 +++ b/tests/test-demandimport.py.out Fri May 11 00:58:51 2018 -0400 @@ -7,10 +7,10 @@ os = <unloaded module 'os'> os.system = <built-in function system> os = <module 'os' from '?'> -util = <unloaded module 'util'> -util.system = <function system at 0x?> -util = <module 'mercurial.util' from '?'> -util.system = <function system at 0x?> +procutil = <unloaded module 'procutil'> +procutil.system = <function system at 0x?> +procutil = <module 'mercurial.utils.procutil' from '?'> +procutil.system = <function system at 0x?> hgweb = <unloaded module 'hgweb'> hgweb_mod = <unloaded module 'hgweb_mod'> hgweb = <module 'mercurial.hgweb' from '?'>