Skip to content

Commit 69ced94

Browse files
committed
FIX: solve travis errors
1 parent cc1ac4d commit 69ced94

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
"""Fixture module to skip the unsupervised_learning.rst doctest for
2-
versions of SciPy earlier than 0.12.0.
1+
"""Fixture module to skip the unsupervised_learning.rst doctest for
2+
versions of SciPy earlier than 0.12.0.
33
"""
44
from sklearn.utils.testing import SkipTest
55
from sklearn.utils.fixes import sp_version
6+
from sklearn.utils import parse_version
67

78
def setup_module(module):
8-
if sp_version < (0, 12):
9+
if sp_version < parse_version('0.12'):
910
raise SkipTest("Skipping because SciPy version earlier than 0.12.0 and "
1011
"thus does not include the scipy.misc.face() image.")

sklearn/neighbors/tests/test_dist_metrics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_cdist(self):
6060

6161
def check_cdist(self, metric, kwargs, D_true):
6262
if metric == 'canberra' and \
63-
parse_version(scipy.__version__) <= parse_version('0.9'):
63+
parse_version(scipy.__version__) <= parse_version('0.9'):
6464
raise SkipTest("Canberra distance incorrect in scipy < 0.9")
6565
dm = DistanceMetric.get_metric(metric, **kwargs)
6666
D12 = dm.pairwise(self.X1, self.X2)
@@ -84,8 +84,8 @@ def test_pdist(self):
8484
yield self.check_pdist_bool, metric, D_true
8585

8686
def check_pdist(self, metric, kwargs, D_true):
87-
if metric == 'canberra' and \
88-
parse_version(scipy.__version__) <= parse_version('0.9'):
87+
if metric == 'canberra' \
88+
parse_version(scipy.__version__) <= parse_version('0.9'):
8989
raise SkipTest("Canberra distance incorrect in scipy < 0.9")
9090
dm = DistanceMetric.get_metric(metric, **kwargs)
9191
D12 = dm.pairwise(self.X1)

0 commit comments

Comments
 (0)