Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b37f142

Browse files
committed
TST: tweak tests so they run
1 parent 19182c6 commit b37f142

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ def psfont(*args, **kwargs):
195195
fig.savefig(tmpfile, format='pdf')
196196

197197

198-
def test_pdf_savefig_when_color_is_none(tempdir_factory):
199-
rcParams['_internal.classic_mode'] = False
200-
plt.subplot()
198+
@pytest.mark.style('default')
199+
def test_pdf_savefig_when_color_is_none(tmpdir_factory):
200+
fig, ax = plt.subplots()
201201
plt.axis('off')
202-
plt.plot(np.sin(np.linspace(-5, 5, 100)), 'v', c='none')
202+
ax.plot(np.sin(np.linspace(-5, 5, 100)), 'v', c='none')
203203
tmpdir_name = str(np.random.randint(100000, 10000000))
204-
actual_image = tempdir_factory.mktemp(tmpdir_name).join('figure.pdf')
205-
expected_image = tempdir_factory.mktemp(tmpdir_name).join('figure.eps')
206-
plt.savefig(str(actual_image), format='pdf')
207-
plt.savefig(str(expected_image), format='eps')
204+
actual_image = tmpdir_factory.mktemp(tmpdir_name).join('figure.pdf')
205+
expected_image = tmpdir_factory.mktemp(tmpdir_name).join('figure.eps')
206+
fig.savefig(str(actual_image), format='pdf')
207+
fig.savefig(str(expected_image), format='eps')
208208
result = compare_images(str(actual_image), str(expected_image), 0)
209209
assert result is None

0 commit comments

Comments
 (0)