8000 Merge pull request #7915 from QuLogic/pytest-sphinxext · matplotlib/matplotlib@1f3c02b · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f3c02b

Browse files
authored
Merge pull request #7915 from QuLogic/pytest-sphinxext
Convert sphinxext tests to pytest.
2 parents 7f476f5 + 0f65a92 commit 1f3c02b

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

lib/matplotlib/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,6 @@ def _jupyter_nbextension_paths():
14931493
'matplotlib.tests.test_usetex',
14941494
'matplotlib.tests.test_widgets',
14951495
'matplotlib.tests.test_cycles',
1496-
'matplotlib.sphinxext.tests.test_tinypages',
14971496
]
14981497

14991498

lib/matplotlib/sphinxext/tests/test_tinypages.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
from subprocess import call, Popen, PIPE
99

10-
from nose import SkipTest
11-
from nose.tools import assert_true
10+
import pytest
11+
1212

1313
HERE = dirname(__file__)
1414
TINY_PAGES = pjoin(HERE, 'tinypages')
@@ -19,7 +19,7 @@ def setup_module():
1919
try:
2020
ret = call(['sphinx-build', '--help'], stdout=PIPE, stderr=PIPE)
2121
except OSError:
22-
raise SkipTest('Need sphinx-build on path for these tests')
22+
pytest.skip('Need sphinx-build on path for these tests')
2323
if ret != 0:
2424
raise RuntimeError('sphinx-build does not return 0')
2525

@@ -60,29 +60,29 @@ def teardown_class(cls):
6060
shutil.rmtree(cls.page_build)
6161

6262
def test_some_plots(self):
63-
assert_true(isdir(self.html_dir))
63+
assert isdir(self.html_dir)
6464

6565
def plot_file(num):
6666
return pjoin(self.html_dir, 'some_plots-{0}.png'.format(num))
6767

6868
range_10, range_6, range_4 = [plot_file(i) for i in range(1, 4)]
6969
# Plot 5 is range(6) plot
70-
assert_true(file_same(range_6, plot_file(5)))
70+
assert file_same(range_6, plot_file(5))
7171
# Plot 7 is range(4) plot
72-
assert_true(file_same(range_4, plot_file(7)))
72+
assert file_same(range_4, plot_file(7))
7373
# Plot 11 is range(10) plot
74-
assert_true B7B5 (file_same(range_10, plot_file(11)))
74+
assert file_same(range_10, plot_file(11))
7575
# Plot 12 uses the old range(10) figure and the new range(6) figure
76-
assert_true(file_same(range_10, plot_file('12_00')))
77-
assert_true(file_same(range_6, plot_file('12_01')))
76+
assert file_same(range_10, plot_file('12_00'))
77+
assert file_same(range_6, plot_file('12_01'))
7878
# Plot 13 shows close-figs in action
79-
assert_true(file_same(range_4, plot_file(13)))
79+
assert file_same(range_4, plot_file(13))
8080
# Plot 14 has included source
8181
with open(pjoin(self.html_dir, 'some_plots.html'), 'rb') as fobj:
8282
html_contents = fobj.read()
83-
assert_true(b'# Only a comment' in html_contents)
83+
assert b'# Only a comment' in html_contents
8484
# check plot defined in external file.
85-
assert_true(file_same(range_4, pjoin(self.html_dir, 'range4.png')))
86-
assert_true(file_same(range_6, pjoin(self.html_dir, 'range6.png')))
85+
assert file_same(range_4, pjoin(self.html_dir, 'range4.png'))
86+
assert file_same(range_6, pjoin(self.html_dir, 'range6.png'))
8787
# check if figure caption made it into html file
88-
assert_true(b'This is the caption for plot 15.' in html_contents)
88+
assert b'This is the caption for plot 15.' in html_contents

0 commit comments

Comments
 (0)
0