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

Skip to content

Commit d38ec34

Browse files
committed
Skip test if latex not installed
Cannot use the decorator for similar reasons as #6263
1 parent 50c0b74 commit d38ec34

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/matplotlib/tests/test_usetex.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
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

910
@image_comparison(baseline_images=['test_usetex'],
1011
extensions=['pdf', 'png'],
1112
tol=0.3)
1213
def test_usetex():
14+
cmd = ['latex', '-version']
15+
try:
16+
check_output(cmd)
17+
except:
18+
from nose import SkipTest
19+
raise SkipTest('missing command: %s' % cmd[0])
1320
matplotlib.rcParams['text.usetex'] = True
1421
fig = plt.figure()
1522
ax = fig.add_subplot(111)

0 commit comments

Comments
 (0)