Skip to content

Commit e603bd7

Browse files
committed
update tests to load superanimal models
1 parent 18befee commit e603bd7

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

tests/test_modeldownload.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@ def test_download_huggingface_model(tmp_path_factory, model="full_cat"):
2323
# Verify that the Hugging Face folder was removed
2424
assert not any(f.startswith("models--") for f in os.listdir(folder))
2525

26+
def test_download_huggingface_superanimalmousemodel(tmp_path_factory, model="superanimal_topviewmouse"):
27+
folder = tmp_path_factory.mktemp("temp")
28+
dlclibrary.download_huggingface_model(model, str(folder))
29+
30+
assert os.path.exists(folder / "pose_cfg.yaml")
31+
assert any(f.startswith("snapshot-") for f in os.listdir(folder))
32+
# Verify that the Hugging Face folder was removed
33+
assert not any(f.startswith("models--") for f in os.listdir(folder))
34+
35+
def test_download_huggingface_superquadrupedmodel(tmp_path_factory, model="superanimal_quadruped"):
36+
folder = tmp_path_factory.mktemp("temp")
37+
dlclibrary.download_huggingface_model(model, str(folder))
38+
39+
assert os.path.exists(folder / "pose_cfg.yaml")
40+
assert any(f.startswith("snapshot-") for f in os.listdir(folder))
41+
# Verify that the Hugging Face folder was removed
42+
assert not any(f.startswith("models--") for f in os.listdir(folder))
43+
2644

2745
def test_download_huggingface_wrong_model():
2846
with pytest.raises(ValueError):
@@ -38,4 +56,5 @@ def test_parse_superanimal_models():
3856
@pytest.mark.skip
3957
@pytest.mark.parametrize("model", MODELOPTIONS)
4058
def test_download_all_models(tmp_path_factory, model):
59+
print("Downloading ...", model)
4160
test_download_huggingface_model(tmp_path_factory, model)

tools/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ from the repository root (this needs `pip install licenseheaders`)
1313
You can edit the `NOTICE.yml` to update the header.
1414

1515

16-
## Running tests
16+
## Running tests [with more details](https://docs.pytest.org/en/latest/how-to/capture-stdout-stderr.html)
1717

1818
``` bash
19-
pytest
19+
pytest -s
2020
```

0 commit comments

Comments
 (0)