Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simplify some Sphinx tests#30090

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
oscargus merged 1 commit intomatplotlib:mainfromQuLogic:simplify-test-sphinx
May 21, 2025
Merged
Changes fromall 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
23 changes: 7 additions & 16 deletionslib/matplotlib/tests/test_sphinxext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,9 +21,13 @@ def build_sphinx_html(source_dir, doctree_dir, html_dir, extra_args=None):
extra_args = [] if extra_args is None else extra_args
cmd = [sys.executable, '-msphinx', '-W', '-b', 'html',
'-d', str(doctree_dir), str(source_dir), str(html_dir), *extra_args]
# On CI, gcov emits warnings (due to agg headers being included with the
# same name in multiple extension modules -- but we don't care about their
# coverage anyways); hide them using GCOV_ERROR_FILE.
proc = subprocess_run_for_testing(
cmd, capture_output=True, text=True,
env={**os.environ, "MPLBACKEND": ""})
env={**os.environ, "MPLBACKEND": "", "GCOV_ERROR_FILE": os.devnull}
)
out = proc.stdout
err = proc.stderr

Expand All@@ -40,18 +44,6 @@ def test_tinypages(tmp_path):
html_dir = tmp_path / '_build' / 'html'
img_dir = html_dir / '_images'
doctree_dir = tmp_path / 'doctrees'
# Build the pages with warnings turned into errors
cmd = [sys.executable, '-msphinx', '-W', '-b', 'html',
'-d', str(doctree_dir), str(tinypages), str(html_dir)]
# On CI, gcov emits warnings (due to agg headers being included with the
# same name in multiple extension modules -- but we don't care about their
# coverage anyways); hide them using GCOV_ERROR_FILE.
proc = subprocess_run_for_testing(
cmd, capture_output=True, text=True,
env={**os.environ, "MPLBACKEND": "", "GCOV_ERROR_FILE": os.devnull}
)
out = proc.stdout
err = proc.stderr

# Build the pages with warnings turned into errors
build_sphinx_html(tmp_path, doctree_dir, html_dir)
Expand DownExpand Up@@ -185,13 +177,12 @@ def test_show_source_link_false(tmp_path, plot_html_show_source_link):


def test_srcset_version(tmp_path):
shutil.copytree(tinypages, tmp_path, dirs_exist_ok=True)
html_dir = tmp_path / '_build' / 'html'
img_dir = html_dir / '_images'
doctree_dir = tmp_path / 'doctrees'

build_sphinx_html(tmp_path, doctree_dir, html_dir, extra_args=[
'-D', 'plot_srcset=2x'])
build_sphinx_html(tinypages, doctree_dir, html_dir,
extra_args=['-D', 'plot_srcset=2x'])

def plot_file(num, suff=''):
return img_dir / f'some_plots-{num}{suff}.png'
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp