Skip to content

Commit 7790cc2

Browse files
authored
Merge pull request #23 from DeepLabCut/fix_tests
Fix test_modeldownload.py
2 parents 1ef80b6 + 95f3932 commit 7790cc2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_modeldownload.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ def test_download_huggingface_model(tmp_path_factory, model="full_cat"):
1818
folder = tmp_path_factory.mktemp("temp")
1919
dlclibrary.download_huggingface_model(model, str(folder))
2020

21-
assert os.path.exists(folder / "pose_cfg.yaml")
22-
assert any(f.startswith("snapshot-") for f in os.listdir(folder))
21+
try: # These are not created for .pt models
22+
assert os.path.exists(folder / "pose_cfg.yaml")
23+
assert any(f.startswith("snapshot-") for f in os.listdir(folder))
24+
except AssertionError:
25+
assert any(f.endswith(".pth") for f in os.listdir(folder))
26+
2327
# Verify that the Hugging Face folder was removed
2428
assert not any(f.startswith("models--") for f in os.listdir(folder))
2529

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

3741

38-
#@pytest.mark.skip # Not skipping as rarely run!
3942
@pytest.mark.parametrize("model", MODELOPTIONS)
4043
def test_download_all_models(tmp_path_factory, model):
4144
print("Downloading ...", model)

0 commit comments

Comments
 (0)