提交 6c24e0ec authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix import crash when no scipy and skip test

上级 b73d2f20
......@@ -3,7 +3,12 @@ from copy import copy
from unittest import TestCase
import numpy as np
import scipy.special
imported_scipy_special = False
try:
import scipy.special
imported_scipy_special = True
except ImportError:
pass
import theano
from theano import scalar, gof, tensor
......@@ -73,6 +78,8 @@ class TestMathErrorFunctions(TestCase):
@classmethod
def setUpClass(cls):
if not imported_scipy_special:
raise SkipTest("scipy.special needed")
# NB: erfinv is defined in ]-1;1[, and erfcinv is defined in ]0;2[,
# so we just take some values in an interval that covers both domains
# (this will also allow to test some values outside the domains).
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论