Skip to content

Commit ec10769

Browse files
committed
Update test for SuperAnimalPrediction to handle ImportError for missing dependencies
Modified the test to raise an ImportError with a specific message when the required 'fmpose3d[animals]' package is not installed, improving error handling and clarity in dependency management.
1 parent 3d1253a commit ec10769

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/fmpose3d_api/test_fmpose3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,8 @@ def test_predict_raises_clear_error_without_deeplabcut(self):
747747
frames = np.random.randint(0, 255, (1, 64, 64, 3), dtype=np.uint8)
748748

749749
with patch(
750-
"fmpose3d.inference_api.fmpose3d.importlib.util.find_spec",
751-
return_value=None,
750+
"fmpose3d.inference_api.fmpose3d._require_superanimal_analyze_images",
751+
side_effect=ImportError('pip install "fmpose3d[animals]"'),
752752
):
753753
with pytest.raises(ImportError, match=r"fmpose3d\[animals\]"):
754754
estimator.predict(frames)

0 commit comments

Comments
 (0)