Checked configuration values for their types. Fixes #1150.

This commit is contained in:
Robert Lehmann
2014-10-30 15:46:02 +01:00
parent 2710f705a1
commit 5cc72ca52b
4 changed files with 44 additions and 4 deletions

View File

@@ -133,3 +133,11 @@ def test_config_eol(tmpdir):
cfg = Config(tmpdir, 'conf.py', {}, None)
cfg.init_values(lambda warning: 1/0)
assert cfg.project == u'spam'
@with_app(confoverrides={'master_doc': 123})
def test_check_types(app, status, warning):
# WARNING: the config value 'master_doc' has type `int', defaults to `str.'
assert any(buf.startswith('WARNING:')
and 'master_doc' in buf and 'int' in buf and 'str' in buf
for buf in warning.buflist)