Skip to content

Commit 80635fa

Browse files
committed
Revert "[BUG] Temporarily fix issue openml#1586 by marking some failed tests as non-strict expected fail. (openml#1587)"
This reverts commit f9fb3a1. modified: tests/test_datasets/test_dataset_functions.py modified: tests/test_flows/test_flow.py modified: tests/test_flows/test_flow_functions.py modified: tests/test_runs/test_run.py modified: tests/test_runs/test_run_functions.py modified: tests/test_setups/test_setup_functions.py modified: tests/test_tasks/test_classification_task.py modified: tests/test_tasks/test_learning_curve_task.py modified: tests/test_tasks/test_regression_task.py modified: tests/test_tasks/test_task.py modified: tests/test_tasks/test_task_functions.py
1 parent 46480cd commit 80635fa

11 files changed

Lines changed: 0 additions & 59 deletions

tests/test_datasets/test_dataset_functions.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ def test_dataset_by_name_cannot_access_private_data(self):
280280
self.use_production_server()
281281
self.assertRaises(OpenMLPrivateDatasetError, openml.datasets.get_dataset, "NAME_GOES_HERE")
282282

283-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
284283
def test_get_dataset_lazy_all_functions(self):
285284
"""Test that all expected functionality is available without downloading the dataset."""
286285
dataset = openml.datasets.get_dataset(1)
@@ -665,7 +664,6 @@ def test_attributes_arff_from_df_unknown_dtype(self):
665664
with pytest.raises(ValueError, match=err_msg):
666665
attributes_arff_from_df(df)
667666

668-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
669667
def test_create_dataset_numpy(self):
670668
data = np.array([[1, 2, 3], [1.2, 2.5, 3.8], [2, 5, 8], [0, 1, 0]]).T
671669

@@ -753,7 +751,6 @@ def test_create_dataset_list(self):
753751
), "Uploaded ARFF does not match original one"
754752
assert _get_online_dataset_format(dataset.id) == "arff", "Wrong format for dataset"
755753

756-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
757754
def test_create_dataset_sparse(self):
758755
# test the scipy.sparse.coo_matrix
759756
sparse_data = scipy.sparse.coo_matrix(
@@ -871,7 +868,6 @@ def test_get_online_dataset_arff(self):
871868
return_type=arff.DENSE if d_format == "arff" else arff.COO,
872869
), "ARFF files are not equal"
873870

874-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
875871
def test_topic_api_error(self):
876872
# Check server exception when non-admin accessses apis
877873
self.assertRaisesRegex(
@@ -899,7 +895,6 @@ def test_get_online_dataset_format(self):
899895
dataset_id
900896
), "The format of the ARFF files is different"
901897

902-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
903898
def test_create_dataset_pandas(self):
904899
data = [
905900
["a", "sunny", 85.0, 85.0, "FALSE", "no"],
@@ -1124,7 +1119,6 @@ def test_ignore_attributes_dataset(self):
11241119
paper_url=paper_url,
11251120
)
11261121

1127-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
11281122
def test_publish_fetch_ignore_attribute(self):
11291123
"""Test to upload and retrieve dataset and check ignore_attributes"""
11301124
data = [
@@ -1243,7 +1237,6 @@ def test_create_dataset_row_id_attribute_error(self):
12431237
paper_url=paper_url,
12441238
)
12451239

1246-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
12471240
def test_create_dataset_row_id_attribute_inference(self):
12481241
# meta-information
12491242
name = f"{self._get_sentinel()}-pandas_testing_dataset"
@@ -1407,7 +1400,6 @@ def test_data_edit_non_critical_field(self):
14071400
edited_dataset = openml.datasets.get_dataset(did)
14081401
assert edited_dataset.description == desc
14091402

1410-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
14111403
def test_data_edit_critical_field(self):
14121404
# Case 2
14131405
# only owners (or admin) can edit all critical fields of datasets
@@ -1456,7 +1448,6 @@ def test_data_edit_requires_valid_dataset(self):
14561448
description="xor operation dataset",
14571449
)
14581450

1459-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
14601451
def test_data_edit_cannot_edit_critical_field_if_dataset_has_task(self):
14611452
# Need to own a dataset to be able to edit meta-data
14621453
# Will be creating a forked version of an existing dataset to allow the unit test user

tests/test_flows/test_flow.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ def test_to_xml_from_xml(self):
178178
assert new_flow is not flow
179179

180180
@pytest.mark.sklearn()
181-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
182181
def test_publish_flow(self):
183182
flow = openml.OpenMLFlow(
184183
name="sklearn.dummy.DummyClassifier",
@@ -220,7 +219,6 @@ def test_publish_existing_flow(self, flow_exists_mock):
220219
)
221220

222221
@pytest.mark.sklearn()
223-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
224222
def test_publish_flow_with_similar_components(self):
225223
clf = sklearn.ensemble.VotingClassifier(
226224
[("lr", sklearn.linear_model.LogisticRegression(solver="lbfgs"))],
@@ -271,7 +269,6 @@ def test_publish_flow_with_similar_components(self):
271269
TestBase.logger.info(f"collected from {__file__.split('/')[-1]}: {flow3.flow_id}")
272270

273271
@pytest.mark.sklearn()
274-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
275272
def test_semi_legal_flow(self):
276273
# TODO: Test if parameters are set correctly!
277274
# should not throw error as it contains two differentiable forms of
@@ -380,7 +377,6 @@ def get_sentinel():
380377
assert not flow_id
381378

382379
@pytest.mark.sklearn()
383-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
384380
def test_existing_flow_exists(self):
385381
# create a flow
386382
nb = sklearn.naive_bayes.GaussianNB()
@@ -421,7 +417,6 @@ def test_existing_flow_exists(self):
421417
assert downloaded_flow_id == flow.flow_id
422418

423419
@pytest.mark.sklearn()
424-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
425420
def test_sklearn_to_upload_to_flow(self):
426421
iris = sklearn.datasets.load_iris()
427422
X = iris.data

tests/test_flows/test_flow_functions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ def test_are_flows_equal_ignore_if_older(self):
274274
assert_flows_equal(flow, flow, ignore_parameter_values_on_older_children=None)
275275

276276
@pytest.mark.sklearn()
277-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
278277
@unittest.skipIf(
279278
Version(sklearn.__version__) < Version("0.20"),
280279
reason="OrdinalEncoder introduced in 0.20. "
@@ -389,7 +388,6 @@ def test_get_flow_reinstantiate_flow_not_strict_pre_023(self):
389388
assert "sklearn==0.19.1" not in flow.dependencies
390389

391390
@pytest.mark.sklearn()
392-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
393391
def test_get_flow_id(self):
394392
if self.long_version:
395393
list_all = openml.utils._list_all

tests/test_runs/test_run.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def _check_array(array, type_):
118118
assert run_prime_trace_content is None
119119

120120
@pytest.mark.sklearn()
121-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
122121
def test_to_from_filesystem_vanilla(self):
123122
model = Pipeline(
124123
[
@@ -154,7 +153,6 @@ def test_to_from_filesystem_vanilla(self):
154153

155154
@pytest.mark.sklearn()
156155
@pytest.mark.flaky()
157-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
158156
def test_to_from_filesystem_search(self):
159157
model = Pipeline(
160158
[
@@ -189,7 +187,6 @@ def test_to_from_filesystem_search(self):
189187
)
190188

191189
@pytest.mark.sklearn()
192-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
193190
def test_to_from_filesystem_no_model(self):
194191
model = Pipeline(
195192
[("imputer", SimpleImputer(strategy="mean")), ("classifier", DummyClassifier())],
@@ -295,7 +292,6 @@ def assert_run_prediction_data(task, run, model):
295292
assert_method(y_test, saved_y_test)
296293

297294
@pytest.mark.sklearn()
298-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
299295
def test_publish_with_local_loaded_flow(self):
300296
"""
301297
Publish a run tied to a local flow after it has first been saved to
@@ -339,7 +335,6 @@ def test_publish_with_local_loaded_flow(self):
339335
openml.runs.get_run(loaded_run.run_id)
340336

341337
@pytest.mark.sklearn()
342-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
343338
def test_offline_and_online_run_identical(self):
344339
extension = SklearnExtension()
345340

tests/test_runs/test_run_functions.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ def test_run_regression_on_classif_task(self):
413413
task=task,
414414
)
415415

416-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
417416
@pytest.mark.sklearn()
418417
def test_check_erronous_sklearn_flow_fails(self):
419418
task_id = 115 # diabetes; crossvalidation
@@ -882,7 +881,6 @@ def test_run_and_upload_maskedarrays(self):
882881

883882
##########################################################################
884883

885-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
886884
@pytest.mark.sklearn()
887885
def test_learning_curve_task_1(self):
888886
task_id = 801 # diabates dataset
@@ -907,7 +905,6 @@ def test_learning_curve_task_1(self):
907905
)
908906
self._check_sample_evaluations(run.sample_evaluations, num_repeats, num_folds, num_samples)
909907

910-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
911908
@pytest.mark.sklearn()
912909
def test_learning_curve_task_2(self):
913910
task_id = 801 # diabates dataset
@@ -944,7 +941,6 @@ def test_learning_curve_task_2(self):
944941
)
945942
self._check_sample_evaluations(run.sample_evaluations, num_repeats, num_folds, num_samples)
946943

947-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
948944
@pytest.mark.sklearn()
949945
@unittest.skipIf(
950946
Version(sklearn.__version__) < Version("0.21"),
@@ -1023,7 +1019,6 @@ def _test_local_evaluations(self, run):
10231019
assert alt_scores[idx] >= 0
10241020
assert alt_scores[idx] <= 1
10251021

1026-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
10271022
@pytest.mark.sklearn()
10281023
def test_local_run_swapped_parameter_order_model(self):
10291024
clf = DecisionTreeClassifier()
@@ -1039,7 +1034,6 @@ def test_local_run_swapped_parameter_order_model(self):
10391034

10401035
self._test_local_evaluations(run)
10411036

1042-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
10431037
@pytest.mark.sklearn()
10441038
@unittest.skipIf(
10451039
Version(sklearn.__version__) < Version("0.20"),
@@ -1068,7 +1062,6 @@ def test_local_run_swapped_parameter_order_flow(self):
10681062

10691063
self._test_local_evaluations(run)
10701064

1071-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
10721065
@pytest.mark.sklearn()
10731066
@unittest.skipIf(
10741067
Version(sklearn.__version__) < Version("0.20"),
@@ -1106,7 +1099,6 @@ def test_online_run_metric_score(self):
11061099

11071100
self._test_local_evaluations(run)
11081101

1109-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
11101102
@pytest.mark.sklearn()
11111103
@unittest.skipIf(
11121104
Version(sklearn.__version__) < Version("0.20"),
@@ -1168,7 +1160,6 @@ def test_initialize_model_from_run(self):
11681160
assert flowS.components["Imputer"].parameters["strategy"] == '"most_frequent"'
11691161
assert flowS.components["VarianceThreshold"].parameters["threshold"] == "0.05"
11701162

1171-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
11721163
@pytest.mark.sklearn()
11731164
@unittest.skipIf(
11741165
Version(sklearn.__version__) < Version("0.20"),
@@ -1228,7 +1219,6 @@ def test__run_exists(self):
12281219
run_ids = run_exists(task.task_id, setup_exists)
12291220
assert run_ids, (run_ids, clf)
12301221

1231-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
12321222
@pytest.mark.sklearn()
12331223
def test_run_with_illegal_flow_id(self):
12341224
# check the case where the user adds an illegal flow id to a
@@ -1248,7 +1238,6 @@ def test_run_with_illegal_flow_id(self):
12481238
avoid_duplicate_runs=True,
12491239
)
12501240

1251-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
12521241
@pytest.mark.sklearn()
12531242
def test_run_with_illegal_flow_id_after_load(self):
12541243
# Same as `test_run_with_illegal_flow_id`, but test this error is also
@@ -1305,7 +1294,6 @@ def test_run_with_illegal_flow_id_1(self):
13051294
avoid_duplicate_runs=True,
13061295
)
13071296

1308-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
13091297
@pytest.mark.sklearn()
13101298
def test_run_with_illegal_flow_id_1_after_load(self):
13111299
# Same as `test_run_with_illegal_flow_id_1`, but test this error is
@@ -1344,7 +1332,6 @@ def test_run_with_illegal_flow_id_1_after_load(self):
13441332
loaded_run.publish,
13451333
)
13461334

1347-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
13481335
@pytest.mark.sklearn()
13491336
@unittest.skipIf(
13501337
Version(sklearn.__version__) < Version("0.20"),
@@ -1572,7 +1559,6 @@ def test_get_runs_list_by_tag(self):
15721559
runs = openml.runs.list_runs(tag="curves", size=2)
15731560
assert len(runs) >= 1
15741561

1575-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
15761562
@pytest.mark.sklearn()
15771563
@unittest.skipIf(
15781564
Version(sklearn.__version__) < Version("0.20"),
@@ -1609,7 +1595,6 @@ def test_run_on_dataset_with_missing_labels_dataframe(self):
16091595
# repeat, fold, row_id, 6 confidences, prediction and correct label
16101596
assert len(row) == 12
16111597

1612-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
16131598
@pytest.mark.sklearn()
16141599
@unittest.skipIf(
16151600
Version(sklearn.__version__) < Version("0.20"),
@@ -1662,7 +1647,6 @@ def test_get_uncached_run(self):
16621647
with pytest.raises(openml.exceptions.OpenMLCacheException):
16631648
openml.runs.functions._get_cached_run(10)
16641649

1665-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
16661650
@pytest.mark.sklearn()
16671651
def test_run_flow_on_task_downloaded_flow(self):
16681652
model = sklearn.ensemble.RandomForestClassifier(n_estimators=33)
@@ -1703,7 +1687,6 @@ def test_format_prediction_classification_no_probabilities(self):
17031687
with pytest.raises(ValueError, match="`proba` is required for classification task"):
17041688
format_prediction(classification, *ignored_input, proba=None)
17051689

1706-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
17071690
def test_format_prediction_classification_incomplete_probabilities(self):
17081691
classification = openml.tasks.get_task(
17091692
self.TEST_SERVER_TASK_SIMPLE["task_id"],
@@ -1724,15 +1707,13 @@ def test_format_prediction_task_without_classlabels_set(self):
17241707
with pytest.raises(ValueError, match="The classification task must have class labels set"):
17251708
format_prediction(classification, *ignored_input, proba={})
17261709

1727-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
17281710
def test_format_prediction_task_learning_curve_sample_not_set(self):
17291711
learning_curve = openml.tasks.get_task(801, download_data=False) # diabetes;crossvalidation
17301712
probabilities = {c: 0.2 for c in learning_curve.class_labels}
17311713
ignored_input = [0] * 5
17321714
with pytest.raises(ValueError, match="`sample` can not be none for LearningCurveTask"):
17331715
format_prediction(learning_curve, *ignored_input, sample=None, proba=probabilities)
17341716

1735-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
17361717
def test_format_prediction_task_regression(self):
17371718
task_meta_data = self.TEST_SERVER_TASK_REGRESSION["task_meta_data"]
17381719
_task_id = check_task_existence(**task_meta_data)
@@ -1762,7 +1743,6 @@ def test_format_prediction_task_regression(self):
17621743

17631744

17641745

1765-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
17661746
@unittest.skipIf(
17671747
Version(sklearn.__version__) < Version("0.20"),
17681748
reason="SimpleImputer doesn't handle mixed type DataFrame as input",
@@ -1863,7 +1843,6 @@ def test_delete_unknown_run(mock_delete, test_files_directory, test_api_key):
18631843

18641844

18651845
@pytest.mark.sklearn()
1866-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
18671846
@unittest.skipIf(
18681847
Version(sklearn.__version__) < Version("0.21"),
18691848
reason="couldn't perform local tests successfully w/o bloating RAM",
@@ -1940,7 +1919,6 @@ def test__run_task_get_arffcontent_2(parallel_mock):
19401919
)
19411920

19421921

1943-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
19441922
@pytest.mark.sklearn()
19451923
@unittest.skipIf(
19461924
Version(sklearn.__version__) < Version("0.21"),

tests/test_setups/test_setup_functions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def setUp(self):
3434
self.extension = SklearnExtension()
3535
super().setUp()
3636

37-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
3837
@pytest.mark.sklearn()
3938
def test_nonexisting_setup_exists(self):
4039
# first publish a non-existing flow
@@ -82,7 +81,6 @@ def _existing_setup_exists(self, classif):
8281
setup_id = openml.setups.setup_exists(flow)
8382
assert setup_id == run.setup_id
8483

85-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
8684
@pytest.mark.sklearn()
8785
def test_existing_setup_exists_1(self):
8886
def side_effect(self):
@@ -98,13 +96,11 @@ def side_effect(self):
9896
nb = sklearn.naive_bayes.GaussianNB()
9997
self._existing_setup_exists(nb)
10098

101-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
10299
@pytest.mark.sklearn()
103100
def test_exisiting_setup_exists_2(self):
104101
# Check a flow with one hyperparameter
105102
self._existing_setup_exists(sklearn.naive_bayes.GaussianNB())
106103

107-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
108104
@pytest.mark.sklearn()
109105
def test_existing_setup_exists_3(self):
110106
# Check a flow with many hyperparameters

tests/test_tasks/test_classification_task.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,18 @@ def setUp(self, n_levels: int = 1):
1818
self.task_type = TaskType.SUPERVISED_CLASSIFICATION
1919
self.estimation_procedure = 5
2020

21-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
2221
def test_download_task(self):
2322
task = super().test_download_task()
2423
assert task.task_id == self.task_id
2524
assert task.task_type_id == TaskType.SUPERVISED_CLASSIFICATION
2625
assert task.dataset_id == 20
2726
assert task.estimation_procedure_id == self.estimation_procedure
2827

29-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
3028
def test_class_labels(self):
3129
task = get_task(self.task_id)
3230
assert task.class_labels == ["tested_negative", "tested_positive"]
3331

3432

35-
@pytest.mark.xfail(reason="failures_issue_1544", strict=False)
3633
@pytest.mark.server()
3734
def test_get_X_and_Y():
3835
task = get_task(119)

0 commit comments

Comments
 (0)