Add a new keyword argument `override` to Application APIs

This commit is contained in:
Takeshi KOMIYA
2018-03-20 20:43:44 +09:00
parent d7a9c8638b
commit 1a43d47c33
4 changed files with 137 additions and 107 deletions

View File

@@ -58,28 +58,6 @@ def test_extension_in_blacklist(app, status, warning):
assert msg.startswith("WARNING: the extension 'sphinxjp.themecore' was")
def test_domain_override(app, status, warning):
class A(Domain):
name = 'foo'
class B(A):
name = 'foo'
class C(Domain):
name = 'foo'
# No domain know named foo.
with pytest.raises(ExtensionError) as excinfo:
app.override_domain(A)
assert 'domain foo not yet registered' in str(excinfo.value)
assert app.add_domain(A) is None
assert app.override_domain(B) is None
with pytest.raises(ExtensionError) as excinfo:
app.override_domain(C)
assert 'new domain not a subclass of registered foo domain' in str(excinfo.value)
@pytest.mark.sphinx(testroot='add_source_parser')
def test_add_source_parser(app, status, warning):
assert set(app.config.source_suffix) == set(['.rst', '.md', '.test'])