Fixes #1884: plug-in html themes cannot inherit another plug-in theme

Closes #1885: A part of code for this fix is from pull requeest #1885.
refs #1794
This commit is contained in:
shimizukawa
2015-11-22 00:13:42 +09:00
parent f0c390493b
commit 9d0ce7a6c1
7 changed files with 35 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ import zipfile
from sphinx.theming import Theme, ThemeError
from util import with_app, raises, TestApp
from util import with_app, raises, mock, path
@with_app(confoverrides={'html_theme': 'ziptheme',
@@ -79,3 +79,19 @@ def test_js_source(app, status, warning):
assert 'Underscore.js {v}'.format(v=v) in underscore_min, msg
underscore_src = (app.outdir / '_static' / 'underscore-{v}.js'.format(v=v)).text()
assert 'Underscore.js {v}'.format(v=v) in underscore_src, msg
def test_double_inheriting_theme():
from sphinx.theming import load_theme_plugins # load original before patching
def load_themes():
roots = path(__file__).abspath().parent / 'roots'
yield roots / 'test-double-inheriting-theme' / 'base_themes_dir'
for t in load_theme_plugins():
yield t
@mock.patch('sphinx.theming.load_theme_plugins', side_effect=load_themes)
@with_app(testroot='double-inheriting-theme')
def test_double_inheriting_theme_(app, status, warning, m_):
pass
yield test_double_inheriting_theme_