10000 Correct expected output file name in test. · matplotlib/matplotlib@209b341 · GitHub
[go: up one dir, main page]

Skip to content

Commit 209b341

Browse files
committed
Correct expected output file name in test.
1 parent ae41a77 commit 209b341

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

lib/matplotlib/sphinxext/tests/test_tinypages.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ def plot_file(num):
8484
html_contents = fobj.read()
8585
assert_true('# Only a comment' in html_contents)
8686
# check plot defined in external file.
87-
assert_true(file_same(range_4, plot_file(15)))
88-
assert_true(file_same(range_6, plot_file(16)))
89-
assert_true(file_same(range_4, plot_file(17)))
87+
assert_true(file_same(range_4, pjoin(self.html_dir, 'range4.png'))
88+
assert_true(file_same(range_6, pjoin(self.html_dir, 'range6.png'))
9089
# check if figure caption made it into html file
91-
assert_true('This is the caption for plot 17.')
90+
assert_true('This is the caption for plot 15.')
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from matplotlib import pyplot as plt
2+
3+
def range4():
4+
'''This function should never be called if the plot_diective works as expected.'''
5+
raise NotImplementedError
6+
7+
def range6():
8+
plt.figure()
9+
plt.plot(range(6))
10+
plt.show()

lib/matplotlib/sphinxext/tests/tinypages/some_plots.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,15 @@ Plot 14 uses ``include-source``:
115115

116116
# Only a comment
117117

118-
Plot 15 uses an external file with the plot commands:
118+
Plot 15 uses an external file with the plot commands and a caption:
119119

120120
.. plot:: range4.py
121121

122+
This is the caption for plot 15.
123+
124+
122125
Plot 16 uses a specific function in a file with plot commands:
123126

124-
.. plot:: range4.py range6
125-
126-
Plot 17 uses an external file and a caption:
127+
.. plot:: range6.py range6
127128

128-
.. plot:: range4.py
129129

130-
This is the caption for plot 17.

0 commit comments

Comments
 (0)
0