Add HTMLThemeFactory class

This commit is contained in:
Takeshi KOMIYA
2017-04-20 20:19:55 +09:00
parent b405c0aaf5
commit faefe2b5a5
6 changed files with 81 additions and 77 deletions

View File

@@ -10,14 +10,10 @@
"""
import os
import zipfile
import mock
import pytest
from sphinx.theming import Theme, ThemeError
from util import path
from sphinx.theming import ThemeError
@pytest.mark.sphinx(
@@ -27,12 +23,12 @@ def test_theme_api(app, status, warning):
cfg = app.config
# test Theme class API
assert set(Theme.themes.keys()) == \
assert set(app.html_themes.keys()) == \
set(['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku',
'traditional', 'testtheme', 'ziptheme', 'epub', 'nature',
'pyramid', 'bizstyle', 'classic', 'nonav'])
assert Theme.themes['testtheme'] == app.srcdir / 'testtheme'
assert Theme.themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
assert app.html_themes['testtheme'] == app.srcdir / 'testtheme'
assert app.html_themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
# test Theme instance API
theme = app.builder.theme

View File

@@ -24,7 +24,6 @@ from docutils.parsers.rst import directives, roles
from sphinx import application
from sphinx.builders.latex import LaTeXBuilder
from sphinx.theming import Theme
from sphinx.ext.autodoc import AutoDirective
from sphinx.pycode import ModuleAnalyzer
from sphinx.deprecation import RemovedInSphinx17Warning
@@ -168,7 +167,6 @@ class SphinxTestApp(application.Sphinx):
raise
def cleanup(self, doctrees=False):
Theme.themes.clear()
AutoDirective._registry.clear()
ModuleAnalyzer.cache.clear()
LaTeXBuilder.usepackages = []