提交 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,
try:
import pydot as pd
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
g=pd.Dot()
......@@ -708,7 +709,8 @@ def pydotprint_variables(vars,
try:
import pydot as pd
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
g=pd.Dot()
my_list = {}
......
"""
Tests of printing functionality
"""
import logging
import StringIO
from nose.plugins.skip import SkipTest
import theano
import theano.tensor as tensor
......@@ -17,6 +21,12 @@ def test_pydotprint_cond_highlight():
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()
f = theano.function([x], x*2)
f([1,2,3,4])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论