Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbbfef6

Browse files
committed
Use image_comparison decorator in pgf tests.
1 parente903c34 commitbbbfef6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
importmatplotlib.pyplotasplt
1212
frommatplotlib.compatimportsubprocess
1313
frommatplotlib.testing.compareimportcompare_images,ImageComparisonFailure
14-
frommatplotlib.testing.decoratorsimport_image_directories
14+
frommatplotlib.testing.decoratorsimportimage_comparison,_image_directories
1515

1616
baseline_dir,result_dir=_image_directories(lambda:'dummy func')
1717

@@ -81,20 +81,21 @@ def create_figure():
8181

8282
# test compiling a figure to pdf with xelatex
8383
@needs_xelatex
84-
@pytest.mark.style('default')
8584
@pytest.mark.backend('pgf')
85+
@image_comparison(baseline_images=['pgf_xelatex'],extensions=['pdf'],
86+
style='default')
8687
deftest_xelatex():
8788
rc_xelatex= {'font.family':'serif',
8889
'pgf.rcfonts':False}
8990
mpl.rcParams.update(rc_xelatex)
9091
create_figure()
91-
compare_figure('pgf_xelatex.pdf',tol=0)
9292

9393

9494
# test compiling a figure to pdf with pdflatex
9595
@needs_pdflatex
96-
@pytest.mark.style('default')
9796
@pytest.mark.backend('pgf')
97+
@image_comparison(baseline_images=['pgf_pdflatex'],extensions=['pdf'],
98+
style='default')
9899
deftest_pdflatex():
99100
importos
100101
ifos.environ.get('APPVEYOR',False):
@@ -108,7 +109,6 @@ def test_pdflatex():
108109
'\\usepackage[T1]{fontenc}']}
109110
mpl.rcParams.update(rc_pdflatex)
110111
create_figure()
111-
compare_figure('pgf_pdflatex.pdf',tol=0)
112112

113113

114114
# test updating the rc parameters for each figure
@@ -162,8 +162,9 @@ def test_pathclip():
162162

163163
# test mixed mode rendering
164164
@needs_xelatex
165-
@pytest.mark.style('default')
166165
@pytest.mark.backend('pgf')
166+
@image_comparison(baseline_images=['pgf_mixedmode'],extensions=['pdf'],
167+
style='default')
167168
deftest_mixedmode():
168169
rc_xelatex= {'font.family':'serif',
169170
'pgf.rcfonts':False}
@@ -172,7 +173,6 @@ def test_mixedmode():
172173
Y,X=np.ogrid[-1:1:40j,-1:1:40j]
173174
plt.figure()
174175
plt.pcolor(X**2+Y**2).set_rasterized(True)
175-
compare_figure('pgf_mixedmode.pdf',tol=0)
176176

177177

178178
# test bbox_inches clipping

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp