Skip to content
Open
Prev Previous commit
Next Next commit
Apply maintainer cleanup suggestions
  • Loading branch information
codervinitjangir committed Mar 5, 2026
commit 6d0b51d2ea121be97d164b85b434bc713d5ded04
14 changes: 2 additions & 12 deletions tests/test_tasks/test_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import inspect
import os
import shutil
import tempfile
from pathlib import Path

import numpy as np
Expand All @@ -21,11 +20,10 @@ class OpenMLSplitTest(TestBase):

def setUp(self):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't change anything here, keep it as it was

Copy link
Copy Markdown
Collaborator

@geetu040 geetu040 Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1694 (comment) is still unresolved

super().setUp()
self.test_dir = tempfile.mkdtemp()
__file__ = inspect.getfile(OpenMLSplitTest)
self.directory = os.path.dirname(__file__)
# This is for dataset
original_arff_filepath = (
self.arff_filepath = (
Path(self.directory).parent
/ "files"
/ "org"
Expand All @@ -35,21 +33,13 @@ def setUp(self):
/ "1882"
/ "datasplits.arff"
)
self.arff_filepath = Path(self.test_dir) / "datasplits.arff"
shutil.copy(original_arff_filepath, self.arff_filepath)
self.pd_filename = self.arff_filepath.with_suffix(".pkl.py3")

def tearDown(self):
try:
shutil.rmtree(self.test_dir)
except OSError:
# Replaced bare except. Not sure why these exceptions are acceptable.
pass
super().tearDown()
self._temp_dir.cleanup()

def test_eq(self):
split = OpenMLSplit._from_arff_file(self.arff_filepath)
assert split == split # noqa: PLR0124

split2 = OpenMLSplit._from_arff_file(self.arff_filepath)
split2.name = "a"
Expand Down