@@ -21,9 +21,13 @@ def build_sphinx_html(source_dir, doctree_dir, html_dir, extra_args=None):
21
21
extra_args = [] if extra_args is None else extra_args
22
22
cmd = [sys .executable , '-msphinx' , '-W' , '-b' , 'html' ,
23
23
'-d' , str (doctree_dir ), str (source_dir ), str (html_dir ), * extra_args ]
24
+ # On CI, gcov emits warnings (due to agg headers being included with the
25
+ # same name in multiple extension modules -- but we don't care about their
26
+ # coverage anyways); hide them using GCOV_ERROR_FILE.
24
27
proc = subprocess_run_for_testing (
25
28
cmd , capture_output = True , text = True ,
26
- env = {** os .environ , "MPLBACKEND" : "" })
29
+ env = {** os .environ , "MPLBACKEND" : "" , "GCOV_ERROR_FILE" : os .devnull }
30
+ )
27
31
out = proc .stdout
28
32
err = proc .stderr
29
33
@@ -40,18 +44,6 @@ def test_tinypages(tmp_path):
40
44
html_dir = tmp_path / '_build' / 'html'
41
45
img_dir = html_dir / '_images'
42
46
doctree_dir = tmp_path / 'doctrees'
43
- # Build the pages with warnings turned into errors
44
- cmd = [sys .executable , '-msphinx' , '-W' , '-b' , 'html' ,
45
- '-d' , str (doctree_dir ), str (tinypages ), str (html_dir )]
46
- # On CI, gcov emits warnings (due to agg headers being included with the
47
- # same name in multiple extension modules -- but we don't care about their
48
- # coverage anyways); hide them using GCOV_ERROR_FILE.
49
- proc = subprocess_run_for_testing (
50
- cmd , capture_output = True , text = True ,
51
- env = {** os .environ , "MPLBACKEND" : "" , "GCOV_ERROR_FILE" : os .devnull }
52
- )
53
- out = proc .stdout
54
- err = proc .stderr
55
47
56
48
# Build the pages with warnings turned into errors
57
49
build_sphinx_html (tmp_path , doctree_dir , html_dir )
@@ -185,13 +177,12 @@ def test_show_source_link_false(tmp_path, plot_html_show_source_link):
185
177
186
178
187
179
def test_srcset_version (tmp_path ):
188
- shutil .copytree (tinypages , tmp_path , dirs_exist_ok = True )
189
180
html_dir = tmp_path / '_build' / 'html'
190
181
img_dir = html_dir / '_images'
191
182
doctree_dir = tmp_path / 'doctrees'
192
183
193
- build_sphinx_html (tmp_path , doctree_dir , html_dir , extra_args = [
194
- '-D' , 'plot_srcset=2x' ])
184
+ build_sphinx_html (tinypages , doctree_dir , html_dir ,
185
+ extra_args = [ '-D' , 'plot_srcset=2x' ])
195
186
196
187
def plot_file (num , suff = '' ):
197
188
return img_dir / f'some_plots-{ num } { suff } .png'
0 commit comments