11
11
import matplotlib .pyplot as plt
12
12
from matplotlib .compat import subprocess
13
13
from matplotlib .testing .compare import compare_images , ImageComparisonFailure
14
- from matplotlib .testing .decorators import _image_directories
14
+ from matplotlib .testing .decorators import image_comparison , _image_directories
15
15
16
16
baseline_dir , result_dir = _image_directories (lambda : 'dummy func' )
17
17
@@ -81,20 +81,21 @@ def create_figure():
81
81
82
82
# test compiling a figure to pdf with xelatex
83
83
@needs_xelatex
84
- @pytest .mark .style ('default' )
85
84
@pytest .mark .backend ('pgf' )
85
+ @image_comparison (baseline_images = ['pgf_xelatex' ], extensions = ['pdf' ],
86
+ style = 'default' )
86
87
def test_xelatex ():
87
88
rc_xelatex = {'font.family' : 'serif' ,
88
89
'pgf.rcfonts' : False }
89
90
mpl .rcParams .update (rc_xelatex )
90
91
create_figure ()
91
- compare_figure ('pgf_xelatex.pdf' , tol = 0 )
92
92
93
93
94
94
# test compiling a figure to pdf with pdflatex
95
95
@needs_pdflatex
96
- @pytest .mark .style ('default' )
97
96
@pytest .mark .backend ('pgf' )
97
+ @image_comparison (baseline_images = ['pgf_pdflatex' ], extensions = ['pdf' ],
98
+ style = 'default' )
98
99
def test_pdflatex ():
99
100
import os
100
101
if os .environ .get ('APPVEYOR' , False ):
@@ -108,7 +109,6 @@ def test_pdflatex():
108
109
'\\ usepackage[T1]{fontenc}' ]}
109
110
mpl .rcParams .update (rc_pdflatex )
110
111
create_figure ()
111
- compare_figure ('pgf_pdflatex.pdf' , tol = 0 )
112
112
113
113
114
114
# test updating the rc parameters for each figure
@@ -162,8 +162,9 @@ def test_pathclip():
162
162
163
163
# test mixed mode rendering
164
164
@needs_xelatex
165
- @pytest .mark .style ('default' )
166
165
@pytest .mark .backend ('pgf' )
166
+ @image_comparison (baseline_images = ['pgf_mixedmode' ], extensions = ['pdf' ],
167
+ style = 'default' )
167
168
def test_mixedmode ():
168
169
rc_xelatex = {'font.family' : 'serif' ,
169
170
'pgf.rcfonts' : False }
@@ -172,7 +173,6 @@ def test_mixedmode():
172
173
Y , X = np .ogrid [- 1 :1 :40j , - 1 :1 :40j ]
173
174
plt .figure ()
174
175
plt .pcolor (X ** 2 + Y ** 2 ).set_rasterized (True )
175
- compare_figure ('pgf_mixedmode.pdf' , tol = 0 )
176
176
177
177
178
178
# test bbox_inches clipping
0 commit comments