From 7d093ca2f65f7d57d1768647623aee536eee5d63 Mon Sep 17 00:00:00 2001 From: Lennart Purucker Date: Tue, 15 Oct 2024 09:41:41 +0200 Subject: [PATCH 1/3] Fix Random State Bound Bug --- tests/test_runs/test_run_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()), From 51c35e2c0b0a618066581c28a035e7f4ce562b91 Mon Sep 17 00:00:00 2001 From: Lennart Purucker Date: Tue, 15 Oct 2024 10:11:02 +0200 Subject: [PATCH 2/3] fix: skip tests for systems without XDG dirs --- tests/test_openml/test_config.py | 1 + 1 file changed, 1 insertion(+) 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 From 44b36a2f903eaee284e31bd0cceefccd12472049 Mon Sep 17 00:00:00 2001 From: Lennart Purucker Date: Tue, 15 Oct 2024 10:34:34 +0200 Subject: [PATCH 3/3] fix: add ignore errors to shutil to make sure all files are deleted. --- openml/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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