8000 Slightly compress down the pgf tests. · matplotlib/matplotlib@4709aa6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4709aa6

Browse files
committed
Slightly compress down the pgf tests.
1 parent 59bfcfa commit 4709aa6

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -163,29 +163,20 @@ def test_rcupdate():
163163
@pytest.mark.style('default')
164164
@pytest.mark.backend('pgf')
165165
def test_pathclip():
166-
rc_xelatex = {'font.family': 'serif',
167-
'pgf.rcfonts': False}
168-
mpl.rcParams.update(rc_xelatex)
169-
170-
plt.figure()
166+
mpl.rcParams.update({'font.family': 'serif', 'pgf.rcfonts': False})
171167
plt.plot([0., 1e100], [0., 1e100])
172168
plt.xlim(0, 1)
173169
plt.ylim(0, 1)
174-
# this test passes if compiling/saving to pdf works (no image comparison)
175-
plt.savefig(os.path.join(result_dir, "pgf_pathclip.pdf"))
170+
plt.savefig(BytesIO(), format="pdf") # No image comparison.
176171

177172

178173
# test mixed mode rendering
179174
@needs_xelatex
180175
@pytest.mark.backend('pgf')
181176
@image_comparison(['pgf_mixedmode.pdf'], style='default')
182177
def test_mixedmode():
183-
rc_xelatex = {'font.family': 'serif',
184-
'pgf.rcfonts': False}
185-
mpl.rcParams.update(rc_xelatex)
186-
178+
mpl.rcParams.update({'font.family': 'serif', 'pgf.rcfonts': False})
187179
Y, X = np.ogrid[-1:1:40j, -1:1:40j]
188-
plt.figure()
189180
plt.pcolor(X**2 + Y**2).set_rasterized(True)
190181

191182

@@ -194,15 +185,11 @@ def test_mixedmode():
194185
@pytest.mark.style('default')
195186
@pytest.mark.backend('pgf')
196187
def test_bbox_inches():
197-
rc_xelatex = {'font.family': 'serif',
198-
'pgf.rcfonts': False}
199-
mpl.rcParams.update(rc_xelatex)
200-
188+
mpl.rcParams.update({'font.family': 'serif', 'pgf.rcfonts': False})
201189
fig, (ax1, ax2) = plt.subplots(1, 2)
202190
ax1.plot(range(5))
203191
ax2.plot(range(5))
204192
plt.tight_layout()
205-
206193
bbox = ax1.get_window_extent().transformed(fig.dpi_scale_trans.inverted())
207194
compare_figure('pgf_bbox_inches.pdf', savefig_kwargs={'bbox_inches': bbox},
208195
tol=0)

0 commit comments

Comments
 (0)
0