提交 86163a52 authored 作者: David Warde-Farley's avatar David Warde-Farley

Merge pull request #80 from delallea/fix_missing_pydot

Fix missing pydot (tests/error message)
...@@ -466,7 +466,8 @@ def pydotprint(fct, outfile=None, ...@@ -466,7 +466,8 @@ def pydotprint(fct, outfile=None,
try: try:
import pydot as pd import pydot as pd
except ImportError: except ImportError:
print "failed to import pydot. Yous must install pydot for this function to work." print ("Failed to import pydot. You must install pydot for "
"`pydotprint` to work.")
return return
g=pd.Dot() g=pd.Dot()
...@@ -708,7 +709,8 @@ def pydotprint_variables(vars, ...@@ -708,7 +709,8 @@ def pydotprint_variables(vars,
try: try:
import pydot as pd import pydot as pd
except ImportError: except ImportError:
print "failed to import pydot. Yous must install pydot for this function to work." print ("Failed to import pydot. You must install pydot for "
"`pydotprint_variables` to work.")
return return
g=pd.Dot() g=pd.Dot()
my_list = {} my_list = {}
......
""" """
Tests of printing functionality Tests of printing functionality
""" """
import logging import logging
import StringIO import StringIO
from nose.plugins.skip import SkipTest
import theano import theano
import theano.tensor as tensor import theano.tensor as tensor
...@@ -17,6 +21,12 @@ def test_pydotprint_cond_highlight(): ...@@ -17,6 +21,12 @@ def test_pydotprint_cond_highlight():
I did them to help debug stuff. I did them to help debug stuff.
""" """
# Skip test if pydot is not available.
try:
import pydot
except ImportError:
raise SkipTest('pydot not available')
x = tensor.dvector() x = tensor.dvector()
f = theano.function([x], x*2) f = theano.function([x], x*2)
f([1,2,3,4]) f([1,2,3,4])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论