提交 eaa5f525 authored 作者: Frederic's avatar Frederic

Allow to import theano when nose is not installed.

上级 deb3091f
......@@ -78,7 +78,12 @@ from compile import \
from misc.safe_asarray import _asarray
import theano.tests
test = theano.tests.TheanoNoseTester().test
if hasattr(theano.tests, "TheanoNoseTester"):
test = theano.tests.TheanoNoseTester().test
else:
def test():
raise ImportError("The nose module is not installed."
" It is needed for Theano tests.")
FancyModule = Module
......
from main import main, TheanoNoseTester
try:
from main import main, TheanoNoseTester
except ImportError:
pass
import unittest_tools
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论