From 06062431ffff00b31220d257f3094c4e3d9cd1a8 Mon Sep 17 00:00:00 2001 From: PGijsbers Date: Tue, 17 Jun 2025 09:59:12 +0200 Subject: [PATCH] convert test to pytest --- tests/test_datasets/test_dataset_functions.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/test_datasets/test_dataset_functions.py b/tests/test_datasets/test_dataset_functions.py index 1dc9daab1..74248e29c 100644 --- a/tests/test_datasets/test_dataset_functions.py +++ b/tests/test_datasets/test_dataset_functions.py @@ -384,14 +384,6 @@ def test__download_minio_file_works_with_bucket_subdirectory(self): file_destination ), "_download_minio_file can download from subdirectories" - def test__get_dataset_parquet_not_cached(self): - description = { - "oml:parquet_url": "http://data.openml.org/dataset20/dataset_20.pq", - "oml:id": "20", - } - path = _get_dataset_parquet(description, cache_directory=self.workdir) - assert isinstance(path, Path), "_get_dataset_parquet returns a path" - assert path.is_file(), "_get_dataset_parquet returns path to real file" @mock.patch("openml._api_calls._download_minio_file") def test__get_dataset_parquet_is_cached(self, patch): @@ -1955,6 +1947,17 @@ def test_get_dataset_with_invalid_id() -> None: openml.datasets.get_dataset(INVALID_ID) assert e.value.code == 111 + +def test__get_dataset_parquet_not_cached(): + description = { + "oml:parquet_url": "http://data.openml.org/dataset20/dataset_20.pq", + "oml:id": "20", + } + path = _get_dataset_parquet(description, cache_directory=Path(openml.config.get_cache_directory())) + assert isinstance(path, Path), "_get_dataset_parquet returns a path" + assert path.is_file(), "_get_dataset_parquet returns path to real file" + + def test_read_features_from_xml_with_whitespace() -> None: from openml.datasets.dataset import _read_features features_file = Path(__file__).parent.parent / "files" / "misc" / "features_with_whitespaces.xml"