Skip to content

Commit

Permalink
Test fix (#26)
Browse files Browse the repository at this point in the history
* added logic to only check for pdf when pdflatex is installed

* Simplified logic
  • Loading branch information
ewu63 authored Mar 27, 2020
1 parent af5c19e commit 7b92273
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyxdsm/tests/test_xdsm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
import os
from pyxdsm.XDSM import XDSM, __file__

from numpy.distutils.exec_command import find_executable

class TestXDSM(unittest.TestCase):

Expand Down Expand Up @@ -36,7 +36,10 @@ def test_examples(self):
os.system('python {}.py'.format(f))
self.assertTrue(os.path.isfile(f + '.tikz'))
self.assertTrue(os.path.isfile(f + '.tex'))
self.assertTrue(os.path.isfile(f + '.pdf'))
# look for the pdflatex executable
pdflatex = find_executable('pdflatex') is not None
# if no pdflatex, then do not assert that the pdf was compiled
self.assertTrue(not pdflatex or os.path.isfile(f + '.pdf'))
os.system('python mat_eqn.py')
self.assertTrue(os.path.isfile('mat_eqn_example.pdf'))
# change back to previous directory
Expand Down

0 comments on commit 7b92273

Please sign in to comment.