Allow parallel execution of tests in `test_search` (#11292)

Add various ``app.builder.build_all()`` calls.
This commit is contained in:
Martin Liška
2023-04-05 14:54:09 +02:00
committed by GitHub
parent 8e26d78b79
commit fc4fead40d
2 changed files with 4 additions and 1 deletions

View File

@@ -456,7 +456,7 @@ def test_literalinclude_file_whole_of_emptyline(app, status, warning):
@pytest.mark.sphinx('html', testroot='directive-code')
def test_literalinclude_caption_html(app, status, warning):
app.builder.build('index')
app.builder.build_all()
html = (app.outdir / 'caption.html').read_text(encoding='utf8')
caption = ('<div class="code-block-caption">'
'<span class="caption-number">Listing 2 </span>'

View File

@@ -110,6 +110,7 @@ def test_stemmer_does_not_remove_short_words(app):
@pytest.mark.sphinx(testroot='search')
def test_stemmer(app):
app.builder.build_all()
searchindex = load_searchindex(app.outdir / 'searchindex.js')
print(searchindex)
assert is_registered_term(searchindex, 'findthisstemmedkei')
@@ -118,6 +119,7 @@ def test_stemmer(app):
@pytest.mark.sphinx(testroot='search')
def test_term_in_heading_and_section(app):
app.builder.build_all()
searchindex = (app.outdir / 'searchindex.js').read_text(encoding='utf8')
# if search term is in the title of one doc and in the text of another
# both documents should be a hit in the search index as a title,
@@ -128,6 +130,7 @@ def test_term_in_heading_and_section(app):
@pytest.mark.sphinx(testroot='search')
def test_term_in_raw_directive(app):
app.builder.build_all()
searchindex = load_searchindex(app.outdir / 'searchindex.js')
assert not is_registered_term(searchindex, 'raw')
assert is_registered_term(searchindex, 'rawword')