mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-08-09 12:38:07 -05:00
Fix #8720: viewcode: module pages are generated for epub on incremental build
The module pages should be generated for epub only if enabled via configuration. But they are generated after the build for other viewcode-supported builders. This checks the current builder on generating module pages.
This commit is contained in:
@@ -49,6 +49,21 @@ def test_viewcode(app, status, warning):
|
||||
'<span> """</span></div>\n') in result
|
||||
|
||||
|
||||
@pytest.mark.sphinx('epub', testroot='ext-viewcode')
|
||||
def test_viewcode_epub_default(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
assert not (app.outdir / '_modules/spam/mod1.xhtml').exists()
|
||||
|
||||
|
||||
@pytest.mark.sphinx('epub', testroot='ext-viewcode',
|
||||
confoverrides={'viewcode_enable_epub': True})
|
||||
def test_viewcode_epub_enabled(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
assert (app.outdir / '_modules/spam/mod1.xhtml').exists()
|
||||
|
||||
|
||||
@pytest.mark.sphinx(testroot='ext-viewcode', tags=['test_linkcode'])
|
||||
def test_linkcode(app, status, warning):
|
||||
app.builder.build(['objects'])
|
||||
|
||||
Reference in New Issue
Block a user