Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix instability in test_ext_viewcode #11297

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/test_ext_viewcode.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Test sphinx.ext.viewcode extension."""

import re
import shutil

import pygments
import pytest


@pytest.mark.sphinx(testroot='ext-viewcode')
@pytest.mark.sphinx(testroot='ext-viewcode', freshenv=True)
def test_viewcode(app, status, warning):
app.builder.build_all()

Expand Down Expand Up @@ -52,6 +53,7 @@ def test_viewcode(app, status, warning):

@pytest.mark.sphinx('epub', testroot='ext-viewcode')
def test_viewcode_epub_default(app, status, warning):
shutil.rmtree(app.outdir)
marxin marked this conversation as resolved.
Show resolved Hide resolved
app.builder.build_all()

assert not (app.outdir / '_modules/spam/mod1.xhtml').exists()
Expand Down Expand Up @@ -83,7 +85,7 @@ def test_linkcode(app, status, warning):
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 find_source(app, modname):
if modname == 'not_a_package':
Expand Down