Merge pull request #21218 from anntzer/mp · matplotlib/matplotlib@10712db · GitHub
Skip to content

Commit 10712db

Browse files
authored
Merge pull request #21218 from anntzer/mp
Parametrize/simplify test_missing_psfont.
2 parents 69cc51a + 2cfc363 commit 10712db

3 files changed

Lines changed: 20 additions & 36 deletions

File tree

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 1 addition & 18 deletions

lib/matplotlib/tests/test_backend_svg.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import datetime
22
from io import BytesIO
3-
import tempfile
43
import xml.etree.ElementTree
54
import xml.parsers.expat
65

76
import numpy as np
87
import pytest
98

109
import matplotlib as mpl
11-
from matplotlib import dviread
1210
from matplotlib.figure import Figure
1311
import matplotlib.pyplot as plt
1412
from matplotlib.testing.decorators import image_comparison, check_figures_equal
@@ -181,22 +179,6 @@ def count_tag(fig, tag):
181179
assert count_tag(fig5, "path") == 1 # axis patch
182180

183181

184-
@needs_usetex
185-
def test_missing_psfont(monkeypatch):
186-
"""An error is raised if a TeX font lacks a Type-1 equivalent"""
187-
188-
def psfont(*args, **kwargs):
189-
return dviread.PsFont(texname='texfont', psname='Some Font',
190-
effects=None, encoding=None, filename=None)
191-
192-
monkeypatch.setattr(dviread.PsfontsMap, '__getitem__', psfont)
193-
mpl.rc('text', usetex=True)
194-
fig, ax = plt.subplots()
195-
ax.text(0.5, 0.5, 'hello')
196-
with tempfile.TemporaryFile() as tmpfile, pytest.raises(ValueError):
197-
fig.savefig(tmpfile, format='svg')
198-
199-
200182
# Use Computer Modern Sans Serif, not Helvetica (which has no \textwon).
201183
@mpl.style.context('default')
202184
@needs_usetex

lib/matplotlib/tests/test_usetex.py

Lines changed: 19 additions & 0 deletions

0 commit comments

Comments
 (0)