@@ -234,19 +234,19 @@ def test_thumbnail_number():
234
234
assert_equal (thumbnail_number , 2 )
235
235
236
236
237
- def test_save_figures ():
237
+ def test_save_figures_mayavi ():
238
238
"""Test file naming when saving figures. Requires mayavi."""
239
239
try :
240
240
from mayavi import mlab
241
241
except ImportError :
242
242
raise nose .SkipTest ('Mayavi not installed' )
243
243
mlab .options .offscreen = True
244
- examples_dir = tempfile .mkdtemp ()
245
244
246
- gallery_conf = {'find_mayavi_figures' : True }
245
+ gallery_conf = build_test_configuration (find_mayavi_figures = True )
246
+
247
247
mlab .test_plot3d ()
248
248
plt .plot (1 , 1 )
249
- fname_template = os .path .join (examples_dir , 'image{0}.png' )
249
+ fname_template = os .path .join (gallery_conf [ ' examples_dir' ] , 'image{0}.png' )
250
250
fig_list , _ = sg .save_figures (fname_template , 0 , gallery_conf )
251
251
assert_equal (len (fig_list ), 2 )
252
252
assert fig_list [0 ].endswith ('image1.png' )
@@ -259,7 +259,7 @@ def test_save_figures():
259
259
assert fig_list [0 ].endswith ('image3.png' )
260
260
assert fig_list [1 ].endswith ('image4.png' )
261
261
262
- shutil .rmtree (examples_dir )
262
+ shutil .rmtree (gallery_conf [ ' examples_dir' ] )
263
263
264
264
# TODO: test that broken thumbnail does appear when needed
265
265
# TODO: test that examples are not executed twice
0 commit comments