@@ -195,15 +195,15 @@ def psfont(*args, **kwargs):
195
195
fig .savefig (tmpfile , format = 'pdf' )
196
196
197
197
198
- def test_pdf_savefig_when_color_is_none ( tempdir_factory ):
199
- rcParams [ '_internal.classic_mode' ] = False
200
- plt .subplot ()
198
+ @ pytest . mark . style ( 'default' )
199
+ def test_pdf_savefig_when_color_is_none ( tmpdir_factory ):
200
+ fig , ax = plt .subplots ()
201
201
plt .axis ('off' )
202
- plt .plot (np .sin (np .linspace (- 5 , 5 , 100 )), 'v' , c = 'none' )
202
+ ax .plot (np .sin (np .linspace (- 5 , 5 , 100 )), 'v' , c = 'none' )
203
203
tmpdir_name = str (np .random .randint (100000 , 10000000 ))
204
- actual_image = tempdir_factory .mktemp (tmpdir_name ).join ('figure.pdf' )
205
- expected_image = tempdir_factory .mktemp (tmpdir_name ).join ('figure.eps' )
206
- plt .savefig (str (actual_image ), format = 'pdf' )
207
- plt .savefig (str (expected_image ), format = 'eps' )
204
+ actual_image = tmpdir_factory .mktemp (tmpdir_name ).join ('figure.pdf' )
205
+ expected_image = tmpdir_factory .mktemp (tmpdir_name ).join ('figure.eps' )
206
+ fig .savefig (str (actual_image ), format = 'pdf' )
207
+ fig .savefig (str (expected_image ), format = 'eps' )
208
208
result = compare_images (str (actual_image ), str (expected_image ), 0 )
209
209
assert result is None
0 commit comments