File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def plot_directive_file(num):
81
81
assert b'# Only a comment' in html_contents
82
82
# check plot defined in external file.
83
83
assert filecmp .cmp (range_4 , img_dir / 'range4.png' )
84
- assert filecmp .cmp (range_6 , img_dir / 'range6 .png' )
84
+ assert filecmp .cmp (range_6 , img_dir / 'range6_range6 .png' )
85
85
# check if figure caption made it into html file
86
86
assert b'This is the caption for plot 15.' in html_contents
87
87
# check if figure caption using :caption: made it into html file
@@ -95,6 +95,8 @@ def plot_directive_file(num):
95
95
# Plot 21 is range(6) plot via an include directive. But because some of
96
96
# the previous plots are repeated, the argument to plot_file() is only 17.
97
97
assert filecmp .cmp (range_6 , plot_file (17 ))
98
+ # plot 22 is from the range6.py file again, but a different function
99
+ assert filecmp .cmp (range_10 , img_dir / 'range6_range10.png' )
98
100
99
101
# Modify the included plot
100
102
contents = (tmp_path / 'included_plot_21.rst' ).read_bytes ()
Original file line number Diff line number Diff line change @@ -11,3 +11,10 @@ def range6():
11
11
plt .figure ()
12
12
plt .plot (range (6 ))
13
13
plt .show ()
14
+
15
+
16
+ def range10 ():
17
+ """The function that should be executed."""
18
+ plt .figure ()
19
+ plt .plot (range (10 ))
20
+ plt .show ()
Original file line number Diff line number Diff line change @@ -168,8 +168,11 @@ scenario:
168
168
169
169
plt.figure()
170
170
plt.plot(range(4))
171
-
171
+
172
172
Plot 21 is generated via an include directive:
173
173
174
174
.. include :: included_plot_21.rst
175
175
176
+ Plot 22 uses a different specific function in a file with plot commands:
177
+
178
+ .. plot :: range6.py range10
You can’t perform that action at this time.
0 commit comments