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