1212import matplotlib .pyplot as plt
1313from matplotlib .compat import subprocess
1414from matplotlib .testing .compare import compare_images , ImageComparisonFailure
15- from matplotlib .testing .decorators import (_image_directories , switch_backend ,
16- cleanup )
15+ from matplotlib .testing .decorators import _image_directories , switch_backend
1716
1817baseline_dir , result_dir = _image_directories (lambda : 'dummy func' )
1918
@@ -83,7 +82,7 @@ def create_figure():
8382
8483# test compiling a figure to pdf with xelatex
8584@needs_xelatex
86- @cleanup ( style = 'classic' )
85+ @pytest . mark . style ( 'classic' )
8786@switch_backend ('pgf' )
8887def test_xelatex ():
8988 rc_xelatex = {'font.family' : 'serif' ,
@@ -95,7 +94,7 @@ def test_xelatex():
9594
9695# test compiling a figure to pdf with pdflatex
9796@needs_pdflatex
98- @cleanup ( style = 'classic' )
97+ @pytest . mark . style ( 'classic' )
9998@switch_backend ('pgf' )
10099def test_pdflatex ():
101100 import os
@@ -117,7 +116,7 @@ def test_pdflatex():
117116# test updating the rc parameters for each figure
118117@needs_xelatex
119118@needs_pdflatex
120- @cleanup ( style = 'classic' )
119+ @pytest . mark . style ( 'classic' )
121120@switch_backend ('pgf' )
122121def test_rcupdate ():
123122 rc_sets = []
@@ -148,7 +147,7 @@ def test_rcupdate():
148147
149148# test backend-side clipping, since large numbers are not supported by TeX
150149@needs_xelatex
151- @cleanup ( style = 'classic' )
150+ @pytest . mark . style ( 'classic' )
152151@switch_backend ('pgf' )
153152def test_pathclip ():
154153 rc_xelatex = {'font.family' : 'serif' ,
@@ -165,7 +164,7 @@ def test_pathclip():
165164
166165# test mixed mode rendering
167166@needs_xelatex
168- @cleanup ( style = 'classic' )
167+ @pytest . mark . style ( 'classic' )
169168@switch_backend ('pgf' )
170169def test_mixedmode ():
171170 rc_xelatex = {'font.family' : 'serif' ,
@@ -180,7 +179,7 @@ def test_mixedmode():
180179
181180# test bbox_inches clipping
182181@needs_xelatex
183- @cleanup ( style = 'classic' )
182+ @pytest . mark . style ( 'classic' )
184183@switch_backend ('pgf' )
185184def test_bbox_inches ():
186185 rc_xelatex = {'font.family' : 'serif' ,
0 commit comments