Skip to content
Open
Prev Previous commit
Next Next commit
Revert setUp to original main branch state and adapt tearDown
  • Loading branch information
codervinitjangir committed Mar 5, 2026
commit d962e74f0223f67baeff5b7f0ba6ba725ae0d8c4
11 changes: 6 additions & 5 deletions tests/test_tasks/test_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ 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._temp_dir = tempfile.TemporaryDirectory()
self.test_dir = tempfile.mkdtemp()
__file__ = inspect.getfile(OpenMLSplitTest)
self.directory = os.path.dirname(__file__)
# This is for dataset
source_arff = (
original_arff_filepath = (
Path(self.directory).parent
/ "files"
/ "org"
Expand All @@ -35,12 +35,13 @@ def setUp(self):
/ "1882"
/ "datasplits.arff"
)
self.arff_filepath = Path(self._temp_dir.name) / "datasplits.arff"
shutil.copy(source_arff, self.arff_filepath)
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):
self._temp_dir.cleanup()
shutil.rmtree(self.test_dir)
super().tearDown()
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.

Suggested change
super().tearDown()
def tearDown(self):
self._temp_dir.cleanup()

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.

tearDown can simply be written as:

    def tearDown(self):
        self._temp_dir.cleanup()


def test_eq(self):
split = OpenMLSplit._from_arff_file(self.arff_filepath)
Expand Down