Skip to content

Commit a22fcc3

Browse files
committed
Add a test for output-base-name with a .py file
1 parent 1fa88dd commit a22fcc3

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

lib/matplotlib/tests/test_sphinxext.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ def plot_directive_file(num):
9696
assert filecmp.cmp(range_6, plot_file(17))
9797
# plot 22 is from the range6.py file again, but a different function
9898
assert filecmp.cmp(range_10, img_dir / 'range6_range10.png')
99-
# plots 23 and 24 use a custom base name
100-
assert filecmp.cmp(range_4, img_dir / 'custom-base-name-1.png')
101-
assert filecmp.cmp(range_6, img_dir / 'custom-base-name-2.png')
99+
# plots 23 through 25 use a custom base name
100+
assert filecmp.cmp(range_6, img_dir / 'custom-base-name-6.png')
101+
assert filecmp.cmp(range_10, img_dir / 'custom-base-name-10.png')
102+
assert filecmp.cmp(range_4, img_dir / 'custom-base-name-4.png')
102103

103104
# Modify the included plot
104105
contents = (tmp_path / 'included_plot_21.rst').read_bytes()

lib/matplotlib/tests/tinypages/some_plots.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,17 @@ Plot 22 uses a different specific function in a file with plot commands:
175175

176176
.. plot:: range6.py range10
177177

178-
Plots 23 and 24 use output-base-name.
178+
Plots 23 through 25 use output-base-name.
179179

180180
.. plot::
181-
:output-base-name: custom-base-name-1
181+
:output-base-name: custom-base-name-6
182182

183-
plt.plot(range(4))
183+
plt.plot(range(6))
184184

185185
.. plot::
186-
:output-base-name: custom-base-name-2
186+
:output-base-name: custom-base-name-10
187187

188-
plt.plot(range(6))
188+
plt.plot(range(10))
189+
190+
.. plot:: range4.py
191+
:output-base-name: custom-base-name-4

0 commit comments

Comments
 (0)