mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Raise a useful error if `theme.conf` doesn't exist (#11671)
This commit is contained in:
@@ -6,7 +6,7 @@ import alabaster
|
||||
import pytest
|
||||
|
||||
import sphinx.builders.html
|
||||
from sphinx.theming import ThemeError
|
||||
from sphinx.theming import Theme, ThemeError
|
||||
|
||||
|
||||
@pytest.mark.sphinx(
|
||||
@@ -62,6 +62,13 @@ def test_theme_api(app, status, warning):
|
||||
assert not os.path.exists(themedir)
|
||||
|
||||
|
||||
def test_nonexistent_theme_conf(tmp_path):
|
||||
# Check that error occurs with a non-existent theme.conf
|
||||
# (https://github.com/sphinx-doc/sphinx/issues/11668)
|
||||
with pytest.raises(ThemeError):
|
||||
Theme('dummy', str(tmp_path), None)
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='double-inheriting-theme')
|
||||
def test_double_inheriting_theme(app, status, warning):
|
||||
assert app.builder.theme.name == 'base_theme2'
|
||||
|
||||
Reference in New Issue
Block a user