1515import matplotlib .pyplot as plt
1616from matplotlib .compat import subprocess
1717from matplotlib .testing .compare import compare_images , ImageComparisonFailure
18- from matplotlib .testing .decorators import _image_directories , switch_backend
18+ from matplotlib .testing .decorators import (_image_directories , switch_backend ,
19+ cleanup )
1920
2021
2122baseline_dir , result_dir = _image_directories (lambda : 'dummy func' )
@@ -79,6 +80,7 @@ def create_figure():
7980
8081
8182# test compiling a figure to pdf with xelatex
83+ @cleanup (style = 'classic' )
8284@switch_backend ('pgf' )
8385def test_xelatex ():
8486 if not check_for ('xelatex' ):
@@ -92,6 +94,7 @@ def test_xelatex():
9294
9395
9496# test compiling a figure to pdf with pdflatex
97+ @cleanup (style = 'classic' )
9598@switch_backend ('pgf' )
9699def test_pdflatex ():
97100 if not check_for ('pdflatex' ):
@@ -108,6 +111,7 @@ def test_pdflatex():
108111
109112
110113# test updating the rc parameters for each figure
114+ @cleanup (style = 'classic' )
111115@switch_backend ('pgf' )
112116def test_rcupdate ():
113117 if not check_for ('xelatex' ) or not check_for ('pdflatex' ):
@@ -137,6 +141,7 @@ def test_rcupdate():
137141
138142
139143# test backend-side clipping, since large numbers are not supported by TeX
144+ @cleanup (style = 'classic' )
140145@switch_backend ('pgf' )
141146def test_pathclip ():
142147 if not check_for ('xelatex' ):
@@ -155,6 +160,7 @@ def test_pathclip():
155160
156161
157162# test mixed mode rendering
163+ @cleanup (style = 'classic' )
158164@switch_backend ('pgf' )
159165def test_mixedmode ():
160166 if not check_for ('xelatex' ):
@@ -171,6 +177,7 @@ def test_mixedmode():
171177
172178
173179# test bbox_inches clipping
180+ @cleanup (style = 'classic' )
174181@switch_backend ('pgf' )
175182def test_bbox_inches ():
176183 if not check_for ('xelatex' ):
0 commit comments