Skip to content

Commit 11717cb

Browse files
committed
simplify global testing class, add (non)-parallel testing to OpenMLDataset
1 parent cd71051 commit 11717cb

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

openml/datasets/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def get_data(self, target=None, target_dtype=int, include_row_id=False,
205205

206206
path = self.data_pickle_file
207207
if not os.path.exists(path):
208-
raise ValueError("Cannot find a ndarray file for dataset %s at"
208+
raise ValueError("Cannot find a ndarray file for dataset %s at "
209209
"location %s " % (self.name, path))
210210
else:
211211
with open(path, "rb") as fh:

openml/testing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TestBase(unittest.TestCase):
1919
Hopefully soon allows using a test server, not the production server.
2020
"""
2121

22-
def setUp(self, tmp_dir_name=None):
22+
def setUp(self):
2323
# This cache directory is checked in to git to simulate a populated
2424
# cache
2525
self.maxDiff = None
@@ -36,8 +36,7 @@ def setUp(self, tmp_dir_name=None):
3636

3737
self.cwd = os.getcwd()
3838
workdir = os.path.dirname(os.path.abspath(__file__))
39-
if tmp_dir_name is None:
40-
tmp_dir_name = 'tmp'
39+
tmp_dir_name = self.id()
4140
self.workdir = os.path.join(workdir, tmp_dir_name)
4241
try:
4342
shutil.rmtree(self.workdir)

tests/test_datasets/test_dataset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010

1111
class OpenMLDatasetTest(unittest.TestCase):
12+
# Splitting not helpful, these test's don't rely on the server and take less
13+
# than 5 seconds.
1214

1315
def setUp(self):
1416
# Load dataset id 1

tests/test_datasets/test_dataset_functions.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
else:
99
import mock
1010

11-
import six
1211
import scipy.sparse
1312

1413
import openml
@@ -29,10 +28,8 @@
2928
class TestOpenMLDataset(TestBase):
3029
_multiprocess_can_split_ = True
3130

32-
def setUp(self, tmp_dir_name=None):
33-
tmp_dir_name = self.id()
34-
print(tmp_dir_name)
35-
super(TestOpenMLDataset, self).setUp(tmp_dir_name=tmp_dir_name)
31+
def setUp(self):
32+
super(TestOpenMLDataset, self).setUp()
3633
self._remove_did1()
3734

3835
def tearDown(self):

0 commit comments

Comments
 (0)