File tree Expand file tree Collapse file tree
lib/matplotlib/sphinxext/tests Expand file tree Collapse file tree Original file line number Diff line number Diff 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 .' )
Original file line number Diff line number Diff line change 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 ()
Original file line number Diff line number Diff 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+
122125Plot 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.
You can’t perform that action at this time.
0 commit comments