Skip to content

Commit 959d56b

Browse files
committed
remove test_deletion_of_cache_dir_faulty_download
This test is not practical. Its goal was to ensure that assets are removed from the cache if they become faulty on the server. However, with the current design, cached assets are always returned without checking the server, making this scenario impossible. Implementing it would require a new health-check mechanism, so the test is obsolete.
1 parent af8810d commit 959d56b

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

tests/test_datasets/test_dataset_functions.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -499,18 +499,6 @@ def test_deletion_of_cache_dir(self):
499499
)
500500
assert not os.path.exists(did_cache_dir)
501501

502-
# get_dataset_description is the only data guaranteed to be downloaded
503-
@mock.patch("openml.datasets.functions._get_dataset_description")
504-
@pytest.mark.test_server()
505-
def test_deletion_of_cache_dir_faulty_download(self, patch):
506-
with mock.patch.object(openml._backend.dataset._http, "get") as patch_get:
507-
patch_get.side_effect = Exception("Boom!")
508-
self.assertRaisesRegex(Exception, "Boom!", openml.datasets.get_dataset, dataset_id=1)
509-
datasets_cache_dir = os.path.join(openml.config.get_cache_directory(), "api/v1/xml/data/1")
510-
#TODO cache path would not be created
511-
if os.path.exists(datasets_cache_dir):
512-
assert len(os.listdir(datasets_cache_dir)) == 0
513-
514502
@pytest.mark.test_server()
515503
def test_publish_dataset(self):
516504
arff_file_path = self.static_cache_dir / "org" / "openml" / "test" / "datasets" / "2" / "dataset.arff"

0 commit comments

Comments
 (0)