Skip to content

Commit b432962

Browse files
committed
Add tests for output-base-name
1 parent 615017a commit b432962

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

lib/matplotlib/tests/test_sphinxext.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ def plot_directive_file(num):
9797
assert filecmp.cmp(range_6, plot_file(17))
9898
# plot 22 is from the range6.py file again, but a different function
9999
assert filecmp.cmp(range_10, img_dir / 'range6_range10.png')
100+
# plots 23 and 24 use a custom base name with {counter}
101+
assert filecmp.cmp(range_4, img_dir / 'custom-base-name-18.png')
102+
assert filecmp.cmp(range_6, img_dir / 'custom-base-name-19.png')
100103

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

lib/matplotlib/tests/tinypages/some_plots.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,15 @@ Plot 21 is generated via an include directive:
174174
Plot 22 uses a different specific function in a file with plot commands:
175175

176176
.. plot:: range6.py range10
177+
178+
Plots 23 and 24 use output-base-name with a {counter}.
179+
180+
.. plot::
181+
:output-base-name: custom-base-name-{counter}
182+
183+
plt.plot(range(4))
184+
185+
.. plot::
186+
:output-base-name: custom-base-name-{counter}
187+
188+
plt.plot(range(6))

0 commit comments

Comments
 (0)