summaryrefslogtreecommitdiff
path: root/tests/test_builder.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_builder.py')
-rw-r--r--tests/test_builder.py34
1 files changed, 13 insertions, 21 deletions
diff --git a/tests/test_builder.py b/tests/test_builder.py
index 09c64ab86..35197a8ef 100644
--- a/tests/test_builder.py
+++ b/tests/test_builder.py
@@ -10,11 +10,12 @@
import pytest
-@pytest.mark.sphinx('dummy', srcdir="test_builder")
+@pytest.mark.sphinx('dummy', srcdir="test_builder", freshenv=True)
def test_incremental_reading(app):
# first reading
updated = app.builder.read()
assert set(updated) == app.env.found_docs == set(app.env.all_docs)
+ assert updated == sorted(updated) # sorted by alphanumeric
# test if exclude_patterns works ok
assert 'subdir/excluded' not in app.env.found_docs
@@ -27,29 +28,20 @@ def test_incremental_reading(app):
# second reading
updated = app.builder.read()
- # "includes" and "images" are in there because they contain references
- # to nonexisting downloadable or image files, which are given another
- # chance to exist
- assert set(updated) == set(['index', 'new', 'includes', 'images'])
+ assert set(updated) == set(['index', 'new'])
assert 'autodoc' not in app.env.all_docs
assert 'autodoc' not in app.env.found_docs
-@pytest.mark.sphinx('dummy')
-def test_env_read_docs(app):
- """By default, docnames are read in alphanumeric order"""
- def on_env_read_docs_1(app, env, docnames):
- pass
-
- app.connect('env-before-read-docs', on_env_read_docs_1)
-
- read_docnames = app.builder.read()
- assert len(read_docnames) > 2 and read_docnames == sorted(read_docnames)
-
- def on_env_read_docs_2(app, env, docnames):
- docnames.remove('images')
+@pytest.mark.sphinx('dummy', testroot='warnings', freshenv=True)
+def test_incremental_reading_for_missing_files(app):
+ # first reading
+ updated = app.builder.read()
+ assert set(updated) == app.env.found_docs == set(app.env.all_docs)
- app.connect('env-before-read-docs', on_env_read_docs_2)
+ # second reading
+ updated = app.builder.read()
- read_docnames = app.builder.read()
- assert len(read_docnames) == 2
+ # "index" is listed up to updated because it contains references
+ # to nonexisting downloadable or image files
+ assert set(updated) == set(['index'])