Skip to content

Commit 8328a17

Browse files
mfeurerPGijsbers
authored andcommitted
Fix openml#1033: skip two unit tests on Windows (openml#1040)
* skip two unit tests on Windows * make tests less strict for Windows
1 parent aa33a98 commit 8328a17

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_openml/test_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class TestConfig(openml.testing.TestBase):
1212
@unittest.mock.patch("os.path.expanduser")
1313
@unittest.mock.patch("openml.config.openml_logger.warning")
1414
@unittest.mock.patch("openml.config._create_log_handlers")
15+
@unittest.skipIf(os.name == "nt", "https://github.com/openml/openml-python/issues/1033")
1516
def test_non_writable_home(self, log_handler_mock, warnings_mock, expanduser_mock):
1617
with tempfile.TemporaryDirectory(dir=self.workdir) as td:
1718
expanduser_mock.side_effect = (

tests/test_runs/test_run_functions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,9 @@ def test__run_task_get_arffcontent_2(self, parallel_mock):
16231623
0.9655172413793104,
16241624
]
16251625
scores = [v for k, v in res[2]["predictive_accuracy"][0].items()]
1626-
self.assertSequenceEqual(scores, expected_scores, seq_type=list)
1626+
np.testing.assert_array_almost_equal(
1627+
scores, expected_scores, decimal=2 if os.name == "nt" else 7
1628+
)
16271629

16281630
@unittest.skipIf(
16291631
LooseVersion(sklearn.__version__) < "0.21",

tests/test_utils/test_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def test_list_all_for_evaluations(self):
8787
self.assertEqual(len(evaluations), required_size)
8888

8989
@unittest.mock.patch("openml.config.get_cache_directory")
90+
@unittest.skipIf(os.name == "nt", "https://github.com/openml/openml-python/issues/1033")
9091
def test__create_cache_directory(self, config_mock):
9192
with tempfile.TemporaryDirectory(dir=self.workdir) as td:
9293
config_mock.return_value = td

0 commit comments

Comments
 (0)