Mercurial > public > mercurial-scm > hg
diff tests/test-trusted.py @ 34858:85a2db47ad50
configitems: adds a developer warning when accessing undeclared configuration
Now that all known options are declared, we setup a warning to make sure it will
stay this way.
We disable the warning in two tests checking other behavior with random options.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 16 Oct 2017 17:41:27 +0200 |
parents | 08fbc97d1364 |
children | 73ccba60aaa1 |
line wrap: on
line diff
--- a/tests/test-trusted.py Tue Oct 17 21:15:31 2017 +0200 +++ b/tests/test-trusted.py Mon Oct 16 17:41:27 2017 +0200 @@ -67,6 +67,13 @@ trusted)) u = uimod.ui.load() + # disable the configuration registration warning + # + # the purpose of this test is to check the old behavior, not to validate the + # behavior from registered item. so we silent warning related to unregisted + # config. + u.setconfig('devel', 'warn-config-unknown', False, 'test') + u.setconfig('devel', 'all-warnings', False, 'test') u.setconfig('ui', 'debug', str(bool(debug))) u.setconfig('ui', 'report_untrusted', str(bool(report))) u.readconfig('.hg/hgrc') @@ -157,6 +164,13 @@ print() print("# read trusted, untrusted, new ui, trusted") u = uimod.ui.load() +# disable the configuration registration warning +# +# the purpose of this test is to check the old behavior, not to validate the +# behavior from registered item. so we silent warning related to unregisted +# config. +u.setconfig('devel', 'warn-config-unknown', False, 'test') +u.setconfig('devel', 'all-warnings', False, 'test') u.setconfig('ui', 'debug', 'on') u.readconfig(filename) u2 = u.copy()