Skip to content

Commit 678a65c

Browse files
committed
MAINT fix 2/3 compability issue
1 parent b7e273b commit 678a65c

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

tests/test_flows/test_flow_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def _check_flow(self, flow):
1717
self.assertTrue(is_string(flow['external_version']) or
1818
flow['external_version'] is None)
1919

20-
def test_list_datasets(self):
20+
def test_list_flows(self):
2121
# We can only perform a smoke test here because we test on dynamic
2222
# data from the internet...
2323
flows = openml.flows.list_flows()
24-
# 3000 as the number of datasets on openml.org
24+
# 3000 as the number of flows on openml.org
2525
self.assertGreaterEqual(len(flows), 3000)
2626
for fid in flows:
2727
self._check_flow(flows[fid])

tests/test_flows/test_sklearn.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
import os
44
import sys
55
import unittest
6-
import unittest.mock
6+
7+
if sys.version_info[0] >= 3:
8+
from unittest import mock
9+
else:
10+
import mock
711

812
import numpy as np
913
import scipy.optimize
@@ -49,7 +53,7 @@ def setUp(self):
4953
self.X = iris.data
5054
self.y = iris.target
5155

52-
@unittest.mock.patch('openml.flows.sklearn_converter._check_dependencies')
56+
@mock.patch('openml.flows.sklearn_converter._check_dependencies')
5357
def test_serialize_model(self, check_dependencies_mock):
5458
model = sklearn.tree.DecisionTreeClassifier(criterion='entropy',
5559
max_features='auto',

0 commit comments

Comments
 (0)