Skip to content

Commit a240027

Browse files
committed
skip a test if scipy is not there.
1 parent e76b11b commit a240027

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

code/test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ def test_logistic_sgd():
1818

1919

2020
def test_logistic_cg():
21-
logistic_cg.cg_optimization_mnist(n_epochs=10)
21+
try:
22+
import scipy
23+
logistic_cg.cg_optimization_mnist(n_epochs=10)
24+
except ImportError:
25+
from nose.plugins.skip import SkipTest
26+
raise SkipTest('SciPy not available. Needed for the logistic_cg example.')
2227

2328

2429
def test_mlp():

0 commit comments

Comments
 (0)