Skip to content

Commit 11e6235

Browse files
authored
Fix #1033: skip two unit tests on Windows (#1040)
* skip two unit tests on Windows * make tests less strict for Windows
1 parent bd8ae14 commit 11e6235

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

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
@@ -1618,7 +1618,9 @@ def test__run_task_get_arffcontent_2(self, parallel_mock):
16181618
0.9655172413793104,
16191619
]
16201620
scores = [v for k, v in res[2]["predictive_accuracy"][0].items()]
1621-
self.assertSequenceEqual(scores, expected_scores, seq_type=list)
1621+
np.testing.assert_array_almost_equal(
1622+
scores, expected_scores, decimal=2 if os.name == "nt" else 7
1623+
)
16221624

16231625
@unittest.skipIf(
16241626
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)