Skip to content

Commit 54931e4

Browse files
committed
skip torch tests if pytorch not available
1 parent fe8676b commit 54931e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/build_spec/test_build_spec.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,17 @@ def _test_build_spec(path, weight_type, tensorflow_version=None):
5656
spec.model.schema.Model().dump(raw_model)
5757

5858

59+
@pytest.mark.skipif(pytest.skip_torch, reason="requires torch")
5960
def test_build_spec_pytorch(unet2d_nuclei_broad_model):
6061
_test_build_spec(unet2d_nuclei_broad_model, "pytorch_state_dict")
6162

6263

64+
@pytest.mark.skipif(pytest.skip_torch, reason="requires torch")
6365
def test_build_spec_onnx(unet2d_nuclei_broad_model):
6466
_test_build_spec(unet2d_nuclei_broad_model, "onnx")
6567

6668

69+
@pytest.mark.skipif(pytest.skip_torch, reason="requires torch")
6770
def test_build_spec_torchscript(unet2d_nuclei_broad_model):
6871
_test_build_spec(unet2d_nuclei_broad_model, "pytorch_script")
6972

0 commit comments

Comments
 (0)