Skip to content

Commit

Permalink
Merge pull request #6918 from jenshnielsen/addtestusetextodefaulttests
Browse files Browse the repository at this point in the history
TST: enable previously leftout test_usetex
  • Loading branch information
tacaswell committed Aug 30, 2016
2 parents 211984d + baab5d2 commit af16ac8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/matplotlib/__init__.py
Expand Up @@ -1544,6 +1544,7 @@ def _jupyter_nbextension_paths():
'matplotlib.tests.test_type1font',
'matplotlib.tests.test_ttconv',
'matplotlib.tests.test_units',
'matplotlib.tests.test_usetex',
'matplotlib.tests.test_widgets',
'matplotlib.tests.test_cycles',
'matplotlib.tests.test_preprocess_data',
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions lib/matplotlib/tests/test_usetex.py
Expand Up @@ -3,11 +3,18 @@

import matplotlib
from matplotlib.testing.decorators import image_comparison
from matplotlib.compat.subprocess import check_output
import matplotlib.pyplot as plt


@image_comparison(baseline_images=['test_usetex'], extensions=['pdf', 'png'])
@image_comparison(baseline_images=['test_usetex'],
extensions=['pdf', 'png'],
tol=0.3)
def test_usetex():
canusetex = matplotlib.checkdep_usetex(True)
if not canusetex:
from nose import SkipTest
raise SkipTest('Cannot run usetex_test')
matplotlib.rcParams['text.usetex'] = True
fig = plt.figure()
ax = fig.add_subplot(111)
Expand All @@ -16,7 +23,7 @@ def test_usetex():
# \left[ ... \right\} draw some variable-height characters,
# \sqrt and \frac draw horizontal rules, \mathrm changes the font
r'\LaTeX\ $\left[\int\limits_e^{2e}'
r'\sqrt\frac{\log^3 x}{x}\,\mathrm{d}x \right\}',
r'\sqrt\frac{\log^3 x}{x}\,\mathrm{d}x \right\}$',
fontsize=24)
ax.set_xticks([])
ax.set_yticks([])

0 comments on commit af16ac8

Please sign in to comment.