Skip to content

Commit 34cdfce

Browse files
committed
Skipping SVG/DOT tests if pydotplus is not installed (closes #81)
1 parent 1773234 commit 34cdfce

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

prov/tests/test_dot.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@
88

99
import unittest
1010

11-
from prov.dot import prov_to_dot
12-
from prov.tests.test_model import AllTestsBase
13-
from prov.tests.utility import DocumentBaseTestCase
14-
15-
16-
class SVGDotOutputTest(DocumentBaseTestCase, AllTestsBase):
17-
"""
18-
One-way output SVG with prov.dot to exercise its code
19-
"""
20-
def do_tests(self, prov_doc, msg=None):
21-
dot = prov_to_dot(prov_doc)
22-
svg_content = dot.create(format="svg")
11+
# Skiping SVG tests if pydotplus is not installed
12+
from pkgutil import find_loader
13+
if find_loader("pydotplus") is not None:
14+
15+
from prov.dot import prov_to_dot
16+
from prov.tests.test_model import AllTestsBase
17+
from prov.tests.utility import DocumentBaseTestCase
18+
19+
20+
class SVGDotOutputTest(DocumentBaseTestCase, AllTestsBase):
21+
"""
22+
One-way output SVG with prov.dot to exercise its code
23+
"""
24+
def do_tests(self, prov_doc, msg=None):
25+
dot = prov_to_dot(prov_doc)
26+
svg_content = dot.create(format="svg")
2327

2428

2529
if __name__ == '__main__':

0 commit comments

Comments
 (0)