diff --git a/openml/testing.py b/openml/testing.py index 9016ff6a9..3f1dbe4e4 100644 --- a/openml/testing.py +++ b/openml/testing.py @@ -115,7 +115,7 @@ def tearDown(self) -> None: """Tear down the test""" os.chdir(self.cwd) try: - shutil.rmtree(self.workdir) + shutil.rmtree(self.workdir, ignore_errors=True) except PermissionError as e: if os.name != "nt": # one of the files may still be used by another process diff --git a/tests/test_openml/test_config.py b/tests/test_openml/test_config.py index 812630ed6..f9ab5eb9f 100644 --- a/tests/test_openml/test_config.py +++ b/tests/test_openml/test_config.py @@ -54,6 +54,7 @@ def test_non_writable_home(self, log_handler_mock, warnings_mock): assert not log_handler_mock.call_args_list[0][1]["create_file_handler"] assert openml.config._root_cache_directory == Path(td) / "something-else" + @unittest.skipIf(platform.system() != "Linux","XDG only exists for Linux systems.") def test_XDG_directories_do_not_exist(self): with tempfile.TemporaryDirectory(dir=self.workdir) as td: # Save previous state diff --git a/tests/test_runs/test_run_functions.py b/tests/test_runs/test_run_functions.py index 55a53fc40..d43a8bab5 100644 --- a/tests/test_runs/test_run_functions.py +++ b/tests/test_runs/test_run_functions.py @@ -1882,7 +1882,7 @@ def test_joblib_backends(self, parallel_mock): reason="SimpleImputer doesn't handle mixed type DataFrame as input", ) def test_delete_run(self): - rs = np.random.randint(1, 2**32 - 1) + rs = np.random.randint(1, 2**31 - 1) clf = sklearn.pipeline.Pipeline( steps=[ (f"test_server_imputer_{rs}", SimpleImputer()),