mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 20:30:30 -06:00
Fix #6531: Failed to load last environment object when extension added
This commit is contained in:
1 parent
05949f8347
commit
d615eff08e
3 files changed
+26
-5
No files matched your search
@@ -11,9 +11,32 @@ import pytest
|
||||
|
||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||
from sphinx.builders.latex import LaTeXBuilder
|
||||
from sphinx.environment import CONFIG_OK, CONFIG_CHANGED, CONFIG_EXTENSIONS_CHANGED, CONFIG_NEW
|
||||
from sphinx.testing.comparer import PathComparer
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy', testroot='basic')
|
||||
def test_config_status(make_app, app_params):
|
||||
args, kwargs = app_params
|
||||
|
||||
# clean build
|
||||
app1 = make_app(*args, freshenv=True, **kwargs)
|
||||
assert app1.env.config_status == CONFIG_NEW
|
||||
app1.build()
|
||||
|
||||
# incremental build (no config changed)
|
||||
app2 = make_app(*args, **kwargs)
|
||||
assert app2.env.config_status == CONFIG_OK
|
||||
|
||||
# incremental build (config entry changed)
|
||||
app3 = make_app(*args, confoverrides={'master_doc': 'content'}, **kwargs)
|
||||
assert app3.env.config_status == CONFIG_CHANGED
|
||||
|
||||
# incremental build (extension changed)
|
||||
app4 = make_app(*args, confoverrides={'extensions': ['sphinx.ext.autodoc']}, **kwargs)
|
||||
assert app4.env.config_status == CONFIG_EXTENSIONS_CHANGED
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy')
|
||||
def test_images(app):
|
||||
app.build()
|
||||
|
||||
Reference in new issue
Block a user