mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-03 12:48:34 -06:00
ENH: Explain rebuilds
This commit is contained in:
1 parent
bbc11a059f
commit
c0e46adc07
3 files changed
+37
-11
No files matched your search
@@ -7,6 +7,8 @@
|
||||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
import os
|
||||
import shutil
|
||||
import pytest
|
||||
|
||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||
@@ -23,18 +25,30 @@ def test_config_status(make_app, app_params):
|
||||
app1 = make_app(*args, freshenv=True, **kwargs)
|
||||
assert app1.env.config_status == CONFIG_NEW
|
||||
app1.build()
|
||||
assert '[new config] 1 added' in app1._status.getvalue()
|
||||
|
||||
# incremental build (no config changed)
|
||||
app2 = make_app(*args, **kwargs)
|
||||
assert app2.env.config_status == CONFIG_OK
|
||||
app2.build()
|
||||
assert "0 added, 0 changed, 0 removed" in app2._status.getvalue()
|
||||
|
||||
# incremental build (config entry changed)
|
||||
app3 = make_app(*args, confoverrides={'master_doc': 'content'}, **kwargs)
|
||||
app3 = make_app(*args, confoverrides={'master_doc': 'indexx'}, **kwargs)
|
||||
fname = os.path.join(app3.srcdir, 'index.rst')
|
||||
assert os.path.isfile(fname)
|
||||
shutil.move(fname, fname[:-4] + 'x.rst')
|
||||
assert app3.env.config_status == CONFIG_CHANGED
|
||||
app3.build()
|
||||
shutil.move(fname[:-4] + 'x.rst', fname)
|
||||
assert "[config changed ('master_doc')] 1 added" in app3._status.getvalue()
|
||||
|
||||
# incremental build (extension changed)
|
||||
app4 = make_app(*args, confoverrides={'extensions': ['sphinx.ext.autodoc']}, **kwargs)
|
||||
assert app4.env.config_status == CONFIG_EXTENSIONS_CHANGED
|
||||
app4.build()
|
||||
want_str = "[extensions changed ('sphinx.ext.autodoc')] 1 added"
|
||||
assert want_str in app4._status.getvalue()
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy')
|
||||
|
||||
Reference in new issue
Block a user