Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_modeldownload.py #23

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/test_modeldownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ def test_download_huggingface_model(tmp_path_factory, model="full_cat"):
folder = tmp_path_factory.mktemp("temp")
dlclibrary.download_huggingface_model(model, str(folder))

assert os.path.exists(folder / "pose_cfg.yaml")
assert any(f.startswith("snapshot-") for f in os.listdir(folder))
try: # These are not created for .pt models
assert os.path.exists(folder / "pose_cfg.yaml")
assert any(f.startswith("snapshot-") for f in os.listdir(folder))
except AssertionError:
assert any(f.endswith(".pth") for f in os.listdir(folder))

# Verify that the Hugging Face folder was removed
assert not any(f.startswith("models--") for f in os.listdir(folder))

Expand All @@ -35,7 +39,6 @@ def test_parse_superanimal_models():
assert "superanimal_topviewmouse" in dict_


#@pytest.mark.skip # Not skipping as rarely run!
@pytest.mark.parametrize("model", MODELOPTIONS)
def test_download_all_models(tmp_path_factory, model):
print("Downloading ...", model)
Expand Down