44import random
55import time
66import sys
7+ import unittest .mock
78
89import numpy as np
910
@@ -1052,8 +1053,11 @@ def test__run_task_get_arffcontent(self):
10521053 num_folds = 10
10531054 num_repeats = 1
10541055
1056+ flow = unittest .mock .Mock ()
1057+ flow .name = 'dummy'
10551058 clf = SGDClassifier (loss = 'log' , random_state = 1 )
10561059 res = openml .runs .functions ._run_task_get_arffcontent (
1060+ flow = flow ,
10571061 extension = self .extension ,
10581062 model = clf ,
10591063 task = task ,
@@ -1246,12 +1250,15 @@ def test_run_on_dataset_with_missing_labels(self):
12461250 # labels only declared in the arff file, but is not present in the
12471251 # actual data
12481252
1253+ flow = unittest .mock .Mock ()
1254+ flow .name = 'dummy'
12491255 task = openml .tasks .get_task (2 )
12501256
12511257 model = Pipeline (steps = [('Imputer' , Imputer (strategy = 'median' )),
12521258 ('Estimator' , DecisionTreeClassifier ())])
12531259
12541260 data_content , _ , _ , _ = _run_task_get_arffcontent (
1261+ flow = flow ,
12551262 model = model ,
12561263 task = task ,
12571264 extension = self .extension ,
@@ -1267,6 +1274,8 @@ def test_run_on_dataset_with_missing_labels(self):
12671274 def test_predict_proba_hardclassifier (self ):
12681275 # task 1 (test server) is important: it is a task with an unused class
12691276 tasks = [1 , 3 , 115 ]
1277+ flow = unittest .mock .Mock ()
1278+ flow .name = 'dummy'
12701279
12711280 for task_id in tasks :
12721281 task = openml .tasks .get_task (task_id )
@@ -1280,12 +1289,14 @@ def test_predict_proba_hardclassifier(self):
12801289 ])
12811290
12821291 arff_content1 , _ , _ , _ = _run_task_get_arffcontent (
1292+ flow = flow ,
12831293 model = clf1 ,
12841294 task = task ,
12851295 extension = self .extension ,
12861296 add_local_measures = True ,
12871297 )
12881298 arff_content2 , _ , _ , _ = _run_task_get_arffcontent (
1299+ flow = flow ,
12891300 model = clf2 ,
12901301 task = task ,
12911302 extension = self .extension ,
0 commit comments