Skip to content

Commit a5601e3

Browse files
committed
relax assumptions on local file structure
1 parent f524d75 commit a5601e3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/test_datasets/test_dataset_functions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,8 +1457,9 @@ def test_data_edit_critical_field(self):
14571457
raise e
14581458
time.sleep(10)
14591459
# Delete the cache dir to get the newer version of the dataset
1460+
14601461
shutil.rmtree(
1461-
os.path.join(self.workdir, "org", "openml", "test", "datasets", str(did)),
1462+
os.path.join(openml.config.get_cache_directory(), "datasets", str(did)),
14621463
)
14631464

14641465
@pytest.mark.uses_test_server()
@@ -1892,9 +1893,8 @@ def _dataset_features_is_downloaded(did: int):
18921893

18931894

18941895
def _dataset_data_file_is_downloaded(did: int):
1895-
parquet_present = _dataset_file_is_downloaded(did, "dataset.pq")
1896-
arff_present = _dataset_file_is_downloaded(did, "dataset.arff")
1897-
return parquet_present or arff_present
1896+
cache_directory = Path(openml.config.get_cache_directory()) / "datasets" / str(did)
1897+
return any(f.suffix in (".pq", ".arff") for f in cache_directory.iterdir())
18981898

18991899

19001900
def _assert_datasets_retrieved_successfully(

0 commit comments

Comments
 (0)