Skip to content

Commit

Permalink
MAINT xfail the fetch_movielens test (#971)
Browse files Browse the repository at this point in the history
* xfail the fetch_movielens test

* fix unbound local error
  • Loading branch information
jeromedockes authored Jun 24, 2024
1 parent 0d69d97 commit 81e5e5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion skrub/datasets/_fetching.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ def _fetch_movielens(dataset_id: str, data_directory: Path | None = None) -> dic

def _download_and_write_movielens_dataset(dataset_id, data_directory, zip_directory):
url = MOVIELENS_URL.format(zip_directory=zip_directory)
tmp_file = None
try:
tmp_file, _ = urllib.request.urlretrieve(url)
data_file = str((zip_directory / f"{dataset_id}.csv").as_posix())
Expand All @@ -489,7 +490,7 @@ def _download_and_write_movielens_dataset(dataset_id, data_directory, zip_direct
members=[data_file, readme_file],
)
except Exception:
if Path(tmp_file).exists():
if tmp_file is not None and Path(tmp_file).exists():
Path(tmp_file).unlink()
raise

Expand Down
1 change: 1 addition & 0 deletions skrub/datasets/tests/test_fetching.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def test_fetch_world_bank_indicator():
assert disk_loaded_info == returned_info


@pytest.mark.xfail(run=False, reason="temporary SSL certificate issue")
def test_fetch_movielens():
"""
Tests the ``fetch_movielens()`` function in a real environment.
Expand Down

0 comments on commit 81e5e5b

Please sign in to comment.