8000 MNT: skip sphinx tests per-test not per-module · matplotlib/matplotlib@66b1647 · GitHub
[go: up one dir, main page]

Skip to content

Commit 66b1647

Browse files
committed
MNT: skip sphinx tests per-test not per-module
1 parent ad9be65 commit 66b1647

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/matplotlib/tests/test_sphinxext.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
import pytest
1111

1212

13-
pytest.importorskip('sphinx',
14-
minversion=None if sys.version_info < (3, 10) else '4.1.3')
13+
def sphinx_skipper(func):
14+
return pytest.importorskip(
15+
'sphinx',
16+
minversion=None if sys.version_info < (3, 10) else '4.1.3')(func)
1517

1618

1719
def _build_sphinx_html(source_dir, doctree_dir, html_dir, extra_args=None):
@@ -31,6 +33,7 @@ def _build_sphinx_html(source_dir, doctree_dir, html_dir, extra_args=None):
3133
assert html_dir.is_dir()
3234

3335

36+
@sphinx_skipper
3437
def test_tinypages(tmpdir):
3538
source_dir = Path(tmpdir) / 'src'
3639
shutil.copytree(Path(__file__).parent / 'tinypages', source_dir)
@@ -115,6 +118,7 @@ def plot_directive_file(num):
115118
assert filecmp.cmp(range_6, plot_file(5))
116119

117120

121+
@sphinx_skipper
118122
def test_plot_html_show_source_link(tmpdir):
119123
source_dir = Path(tmpdir) / 'src'
120124
source_dir.mkdir()
@@ -135,6 +139,5 @@ def test_plot_html_show_source_link(tmpdir):
135139
# plot_html_show_source_link` is False
136140
html_dir2 = source_dir / '_build' / 'html2'
137141
_build_sphinx_html(source_dir, doctree_dir, html_dir2,
138-
extra_args=['-D', 'plot_html_show_source_link=0'])
142+
extra_args=['-D', 'plot_html_show_source_link=0'])
139143
assert "index-1.py" not in [p.name for p in html_dir2.iterdir()]
140-

0 commit comments

Comments
 (0)
0