human
Solve the following python programming problem given the following code:
@pytest.mark.flaky(reruns=3)
@needs_usetex
def test_missing_psfont(monkeypatch):
assistant
#Here is the Python program you requested.

    """An error is raised if a TeX font lacks a Type-1 equivalent
    """
    def psfont(*args, **kwargs):
        return dviread.PsFont(texname=u'texfont', psname=u'Some    Font', effects=None, encoding=None, filename=None)
    monkeypatch.setattr(dviread.PsfontsMap, u'__getitem__', psfont)
    rcParams[u'text.usetex'] = True
    (fig, ax) = plt.subplots()
    ax.text(0.5, 0.5, u'hello')
    with tempfile.TemporaryFile() as tmpfile:
        with pytest.raises(ValueError):
            fig.savefig(tmpfile, format=u'pdf')