Mercurial > public > mercurial-scm > hg-stable
diff tests/test-trusted.py @ 30564:d83ca854fa21
ui: factor out ui.load() to create a ui without loading configs (API)
This allows us to write doctests depending on a ui object, but not on global
configs.
ui.load() is a class method so we can do wsgiui.load(). All ui() calls but
for doctests are replaced with ui.load(). Some of them could be changed to
not load configs later.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 22 Oct 2016 14:35:10 +0900 |
parents | c4040a35b5d9 |
children | 75e4bae56068 |
line wrap: on
line diff
--- a/tests/test-trusted.py Wed Nov 30 19:23:04 2016 +0000 +++ b/tests/test-trusted.py Sat Oct 22 14:35:10 2016 +0900 @@ -66,7 +66,7 @@ print('# %s user, %s group%s' % (kind[user == cuser], kind[group == cgroup], trusted)) - u = uimod.ui() + u = uimod.ui.load() u.setconfig('ui', 'debug', str(bool(debug))) u.setconfig('ui', 'report_untrusted', str(bool(report))) u.readconfig('.hg/hgrc') @@ -156,7 +156,7 @@ print() print("# read trusted, untrusted, new ui, trusted") -u = uimod.ui() +u = uimod.ui.load() u.setconfig('ui', 'debug', 'on') u.readconfig(filename) u2 = u.copy()