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

Skip to content

Commit af16ac8

Browse files
authored
Merge pull request #6918 from jenshnielsen/addtestusetextodefaulttests
TST: enable previously leftout test_usetex
2 parents 211984d + baab5d2 commit af16ac8

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,7 @@ def _jupyter_nbextension_paths():
15441544
'matplotlib.tests.test_type1font',
15451545
'matplotlib.tests.test_ttconv',
15461546
'matplotlib.tests.test_units',
1547+
'matplotlib.tests.test_usetex',
15471548
'matplotlib.tests.test_widgets',
15481549
'matplotlib.tests.test_cycles',
15491550
'matplotlib.tests.test_preprocess_data',

lib/matplotlib/tests/test_usetex.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33

44
import matplotlib
55
from matplotlib.testing.decorators import image_comparison
6+
from matplotlib.compat.subprocess import check_output
67
import matplotlib.pyplot as plt
78

89

9-
@image_comparison(baseline_images=['test_usetex'], extensions=['pdf', 'png'])
10+
@image_comparison(baseline_images=['test_usetex'],
11+
extensions=['pdf', 'png'],
12+
tol=0.3)
1013
def test_usetex():
14+
canusetex = matplotlib.checkdep_usetex(True)
15+
if not canusetex:
16+
from nose import SkipTest
17+
raise SkipTest('Cannot run usetex_test')
1118
matplotlib.rcParams['text.usetex'] = True
1219
fig = plt.figure()
1320
ax = fig.add_subplot(111)
@@ -16,7 +23,7 @@ def test_usetex():
1623
# \left[ ... \right\} draw some variable-height characters,
1724
# \sqrt and \frac draw horizontal rules, \mathrm changes the font
1825
r'\LaTeX\ $\left[\int\limits_e^{2e}'
19-
r'\sqrt\frac{\log^3 x}{x}\,\mathrm{d}x \right\}',
26+
r'\sqrt\frac{\log^3 x}{x}\,\mathrm{d}x \right\}$',
2027
fontsize=24)
2128
ax.set_xticks([])
2229
ax.set_yticks([])

0 commit comments

Comments
 (0)