mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add HTMLThemeFactory class
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user