mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix instability in `test_ext_viewcode
` (#11297)
Use ``freshenv`` argument and remove ``outdir`` for one test as the previous one can leave an unexpected leftover.
This commit is contained in:
parent
f25a36d056
commit
c1c2d758c9
@ -1,12 +1,13 @@
|
|||||||
"""Test sphinx.ext.viewcode extension."""
|
"""Test sphinx.ext.viewcode extension."""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import shutil
|
||||||
|
|
||||||
import pygments
|
import pygments
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx(testroot='ext-viewcode')
|
@pytest.mark.sphinx(testroot='ext-viewcode', freshenv=True)
|
||||||
def test_viewcode(app, status, warning):
|
def test_viewcode(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|
||||||
@ -52,6 +53,7 @@ def test_viewcode(app, status, warning):
|
|||||||
|
|
||||||
@pytest.mark.sphinx('epub', testroot='ext-viewcode')
|
@pytest.mark.sphinx('epub', testroot='ext-viewcode')
|
||||||
def test_viewcode_epub_default(app, status, warning):
|
def test_viewcode_epub_default(app, status, warning):
|
||||||
|
shutil.rmtree(app.outdir)
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
|
||||||
assert not (app.outdir / '_modules/spam/mod1.xhtml').exists()
|
assert not (app.outdir / '_modules/spam/mod1.xhtml').exists()
|
||||||
@ -83,7 +85,7 @@ def test_linkcode(app, status, warning):
|
|||||||
assert 'http://foobar/cpp/' in stuff
|
assert 'http://foobar/cpp/' in stuff
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx(testroot='ext-viewcode-find')
|
@pytest.mark.sphinx(testroot='ext-viewcode-find', freshenv=True)
|
||||||
def test_local_source_files(app, status, warning):
|
def test_local_source_files(app, status, warning):
|
||||||
def find_source(app, modname):
|
def find_source(app, modname):
|
||||||
if modname == 'not_a_package':
|
if modname == 'not_a_package':
|
||||||
|
Loading…
Reference in New Issue
Block a user