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