mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #3893 from useblocks/master
Unknown html_theme_options throw warnings instead of errors.
This commit is contained in:
commit
2e7cc4c2a1
@ -133,8 +133,9 @@ class Theme(object):
|
||||
|
||||
for option, value in iteritems(overrides):
|
||||
if option not in options:
|
||||
raise ThemeError('unsupported theme option %r given' % option)
|
||||
options[option] = value
|
||||
logger.warning('unsupported theme option %r given' % option)
|
||||
else:
|
||||
options[option] = value
|
||||
|
||||
return options
|
||||
|
||||
|
@ -47,8 +47,10 @@ def test_theme_api(app, status, warning):
|
||||
theme.get_config('theme', 'foobar')
|
||||
|
||||
# options API
|
||||
with pytest.raises(ThemeError):
|
||||
theme.get_options({'nonexisting': 'foo'})
|
||||
|
||||
options = theme.get_options({'nonexisting': 'foo'})
|
||||
assert 'nonexisting' not in options.keys()
|
||||
|
||||
options = theme.get_options(cfg.html_theme_options)
|
||||
assert options['testopt'] == 'foo'
|
||||
assert options['nosidebar'] == 'false'
|
||||
|
Loading…
Reference in New Issue
Block a user