Skip to content

Commit

Permalink
fix: Avoid Random State and Other Test Bug (#1362)
Browse files Browse the repository at this point in the history
  • Loading branch information
LennartPurucker authored Oct 15, 2024
1 parent d3bb775 commit 1dc97eb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openml/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/test_openml/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_runs/test_run_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 1dc97eb

Please sign in to comment.